I have the following code which seems to work fine with shape files projected to NAD_1983_StatePlane_North_Dakota_South_FIPS_3302_Feet but I am having problems with a shape file projected in NAD_1983_UTM_Zone_15N. The EPSG SRID's that I am using are 26915 & 4326.
public void renderToMap(ThinkGeo.MapSuite.DesktopEdition.LayerOverlay overlay) { string world = Proj4Projection.GetEpsgParametersString(4326); string extProj = null; if(this.projection.ProjectionType.Equals("ESRI")) { extProj = Proj4Projection.GetEsriParametersString(this.projection.SRID); } else if(this.projection.ProjectionType.Equals("EPSG")) { extProj = Proj4Projection.GetEpsgParametersString(this.projection.SRID); } Proj4Projection proj4Projection = new Proj4Projection(extProj, world); proj4Projection.Open(); ShapeFileFeatureLayer layer = new ShapeFileFeatureLayer(this.fileName, ShapeFileReadWriteMode.ReadOnly); layer.FeatureSource.Projection = proj4Projection; layer.Name = this.description; layer.ZoomLevelSet.ZoomLevel01.IsActive = true; layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; if(this.shapeFileType.Equals("line")) { layer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = LineStyles.Highway3; } else if(this.shapeFileType.Equals("point")) { layer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.City7; } layer.RequireIndex = false; overlay.Layers.Add(this.description.Replace(" ", "").ToLower(), layer); //proj4Projection.Close(); }
I am getting the following exception/stack trace:
System.ArgumentOutOfRangeException was unhandled
Message="The input double value is out of range.\r\nParameter name: maxX"
Source="DesktopEdition"
ParamName="maxX"
StackTrace:
at ThinkGeo.MapSuite.DesktopEdition.Overlay.Draw(GeoCanvas canvas)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.x5021a7a45adbb9ee(Object x3faa3e674cef60b0)
at System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallbackInternal(_ThreadPoolWaitCallback tpWaitCallBack)
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state)
InnerException:
Anybody have any ideas what I have done wrong with the projection stuff?
Thanks.
Curtis