I am trying to produce a map and it seems to be producing the following error. side location conflict [ (427017.60585249, 586151.555117898, NaN) I am not sure why this error would occur, but it only appears when i set the extent to a particular position on a shapefile. I am using the same shapefile for all my maps and they all work until i view this particular extent?
I am using version 3.3.16.
Here is the error in our event Log.
Event Type: Warning
Event Source: ASP.NET 2.0.50727.0
Event Category: Web Event
Event ID: 1309
Date: 15/05/2009
Time: 13:49:40
User: N/A
Computer: WDU456
Description:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 15/05/2009 13:49:40
Event time (UTC): 15/05/2009 12:49:40
Event ID: c28ffd8fbcd54e9fb23c28bf0d37d4df
Event sequence: 3187
Event occurrence: 56
Event detail code: 0
Exception information:
Exception type: TopologyException
Exception message: side location conflict [ (427017.60585249, 586151.555117898, NaN) ]
I will e-mail the shapefile to support for your testing purposes.
All i am trying is loading a particular feature from this shapefile into an inMemoryLayer (the feature is called North_West) this error also appears when using the North_East feature. Then i set the extent. here is the code i am using
Dim ZoomLayer As New InMemoryFeatureLayer Dim ShapeFileFeatureLayer As ShapeFileFeatureLayer Dim AllFeatures As Collections.ObjectModel.Collection(Of Feature)
ShapeFileFeatureLayer = ReportMapLayerItem.GetRegionFeatures -- THIS IS USING THE EURO SHAPEFILE ShapeFileFeatureLayer.FeatureSource.Open()
' get all features AllFeatures = ShapeFileFeatureLayer.FeatureSource.GetAllFeatures(New String() {"REGION"})
ShapeFileFeatureLayer.FeatureSource.Close()
For Each Feat As Feature In AllFeatures
' if matched, add to zoom layer If Feat.ColumnValues("REGION").Trim = "NORTH_WEST" Then ZoomLayer.InternalFeatures.Add(Feat.Id, Feat) End If
Next
' set the correct zoom on a particular shape Me.Map.CurrentExtent = ExtentHelper.GetDrawingExtent(ZoomLayer.GetBoundingBox, 1024, 768)
' close zoom layer ZoomLayer.Close()
' base Me.Map.StaticLayers.Add("BaseLayer", Me.mBaseLayer.ShapeFileLayer) --- THIS IS THE POSTCODE SHAPEFILE I UPLOADED
then i build and output as an image, you should now get the error
I found there is no feature has a column value “NORTH_WEST” but I found one feature’s column value is "NORTH_WEST_EURO_REGION", so that there is no feature be added in the ZoomLayer in your logic; I changed part of your logic as the following code and it works fine. For Each Feat As Feature In AllFeatures If Feat.ColumnValues("REGION").Trim.StartsWith("NORTH_WEST") Then ZoomLayer.InternalFeatures.Add(Feat.Id, Feat) End If Next
Please see the code I tested. If you have any questions please let me know. Dim Map As New MapEngine Dim ZoomLayer As New InMemoryFeatureLayer Dim ShapeFileFeatureLayer As ShapeFileFeatureLayer = New ShapeFileFeatureLayer MapPath("/app_data/euro/european_region_region.shp")) ShapeFileFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1 ShapeFileFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20 Dim BaseLayer As ShapeFileFeatureLayer = New ShapeFileFeatureLayer(MapPath("app_data/postcode/postcode_region.shp")) BaseLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country2 BaseLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.Capital1 BaseLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = LineStyles.Canal1 BaseLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20
ShapeFileFeatureLayer.Open() Dim AllFeatures As Collection(Of Feature) = ShapeFileFeatureLayer.FeatureSource.GetAllFeatures(New String() {"REGION"}) ShapeFileFeatureLayer.Close()
For Each Feat As Feature In AllFeatures If Feat.ColumnValues("REGION").Trim.StartsWith("NORTH_WEST") Then ZoomLayer.InternalFeatures.Add(Feat.Id, Feat) End If Next ZoomLayer.Open() Map.CurrentExtent = ExtentHelper.GetDrawingExtent(ZoomLayer.GetBoundingBox(), 1024, 768) ZoomLayer.Close()
Map.StaticLayers.Add("BaseLayer", BaseLayer) Dim bmp As New Bitmap(1024, 768)
Map.OpenAllLayers() Dim GeoImage = Map.DrawStaticLayers(bmp, GeographyUnit.Meter) Map.CloseAllLayers() bmp.Save("c:\5755.jpeg")