# Projection Issue

**URL:** <https://community.thinkgeo.com/t/projection-issue/928>\
**Category:** WinForms\
**Created:** [December 21, 2009, 10:22pm UTC](https://community.thinkgeo.com/t/projection-issue/928 "2009-12-21T22:22:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Curtis](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@Curtis](https://community.thinkgeo.com/u/Curtis)\
**Post date:** [December 21, 2009, 10:22pm UTC](https://community.thinkgeo.com/t/projection-issue/928/1 "2009-12-21T22:22:38Z")

</div>

I&nbsp;have&nbsp;the&nbsp;following&nbsp;code&nbsp;which&nbsp;seems&nbsp;to&nbsp;work&nbsp;fine&nbsp;with&nbsp;shape&nbsp;files&nbsp;projected&nbsp;to&nbsp;NAD\_1983\_StatePlane\_North\_Dakota\_South\_FIPS\_3302\_Feet&nbsp;but&nbsp;I&nbsp;am&nbsp;having&nbsp;problems&nbsp;with&nbsp;a&nbsp;shape&nbsp;file&nbsp;projected&nbsp;in&nbsp;NAD\_1983\_UTM\_Zone\_15N.&nbsp;&nbsp;&nbsp;The&nbsp;EPSG&nbsp;SRID's&nbsp;that&nbsp;I&nbsp;am&nbsp;using&nbsp;are&nbsp;26915&nbsp;&&nbsp;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(); } `

&nbsp;I&nbsp;am&nbsp;getting&nbsp;the&nbsp;following&nbsp;exception/stack&nbsp;trace:

System.ArgumentOutOfRangeException&nbsp;was&nbsp;unhandled  
  
&nbsp;&nbsp;Message="The&nbsp;input&nbsp;double&nbsp;value&nbsp;is&nbsp;out&nbsp;of&nbsp;range.\r\nParameter&nbsp;name:&nbsp;maxX"  
  
&nbsp;&nbsp;Source="DesktopEdition"  
  
&nbsp;&nbsp;ParamName="maxX"  
  
&nbsp;&nbsp;StackTrace:  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.DesktopEdition.Overlay.Draw(GeoCanvas&nbsp;canvas)  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;ThinkGeo.MapSuite.DesktopEdition.WinformsMap.x5021a7a45adbb9ee(Object&nbsp;x3faa3e674cef60b0)  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Threading.\_ThreadPoolWaitCallback.WaitCallback\_Context(Object&nbsp;state)  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Threading.ExecutionContext.Run(ExecutionContext&nbsp;executionContext,&nbsp;ContextCallback&nbsp;callback,&nbsp;Object&nbsp;state)  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Threading.\_ThreadPoolWaitCallback.PerformWaitCallbackInternal(\_ThreadPoolWaitCallback&nbsp;tpWaitCallBack)  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;System.Threading.\_ThreadPoolWaitCallback.PerformWaitCallback(Object&nbsp;state)  
  
&nbsp;&nbsp;InnerException:&nbsp;  
  
&nbsp;

Anybody&nbsp;have&nbsp;any&nbsp;ideas&nbsp;what&nbsp;I&nbsp;have&nbsp;done&nbsp;wrong&nbsp;with&nbsp;the&nbsp;projection&nbsp;stuff?

Thanks.

Curtis

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [December 22, 2009, 12:14am UTC](https://community.thinkgeo.com/t/projection-issue/928/2 "2009-12-22T00:14:52Z")

</div>

Curtis,&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;for&nbsp;your&nbsp;post&nbsp;and&nbsp;question.&nbsp;  
&nbsp;&nbsp;  
&nbsp;If&nbsp;I&nbsp;am&nbsp;not&nbsp;misunderstanding&nbsp;anything,&nbsp;your&nbsp;data&nbsp;should&nbsp;be&nbsp;in&nbsp;26915&nbsp;projections,&nbsp;and&nbsp;what&nbsp;you&nbsp;are&nbsp;trying&nbsp;to&nbsp;do&nbsp;is&nbsp;to&nbsp;project&nbsp;it&nbsp;into&nbsp;Decimal&nbsp;Degrees&nbsp;(4326)&nbsp;and&nbsp;show&nbsp;it&nbsp;on&nbsp;Decimal&nbsp;Degrees?&nbsp;  
&nbsp;&nbsp;  
&nbsp;If&nbsp;possible,&nbsp;could&nbsp;you&nbsp;send&nbsp;me&nbsp;the&nbsp;26915&nbsp;projected&nbsp;data&nbsp;to&nbsp;me?&nbsp;You&nbsp;could&nbsp;send&nbsp;it&nbsp;to&nbsp;our&nbsp;support&nbsp;([support@thinkgeo.com](mailto:support@thinkgeo.com))&nbsp;and&nbsp;ask&nbsp;him&nbsp;to&nbsp;forward&nbsp;to&nbsp;Yale.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Any&nbsp;more&nbsp;questions&nbsp;just&nbsp;feel&nbsp;free&nbsp;to&nbsp;let&nbsp;me&nbsp;know.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Yale&nbsp;

---

<div class="post-metadata">

**Author:** ![ThinkGeo](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/thinkgeo/32/25029_2.png) [@ThinkGeo](https://community.thinkgeo.com/u/ThinkGeo)\
**Post date:** [December 22, 2009, 8:51pm UTC](https://community.thinkgeo.com/t/projection-issue/928/3 "2009-12-22T20:51:55Z")

</div>

Curtis,

I&nbsp;tried&nbsp;your&nbsp;data,&nbsp;following&nbsp;code&nbsp;should&nbsp;work&nbsp;perfectly.  
`winformsMap1.MapUnit = GeographyUnit.DecimalDegree;winformsMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean); ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(@"..\Support\DesktopEdition\Posts\Post6807\Mahnomen\Mahnomen_Roads.shp");worldLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = LineStyles.Canal1;worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;worldLayer.FeatureSource.Projection = new Proj4Projection(26915, 4326); ShapeFileFeatureLayer worldLayer1 = new ShapeFileFeatureLayer(@"..\..\SampleData\Data\Countries02.shp");worldLayer1.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.CreateSimpleAreaStyle(GeoColor.SimpleColors.Transparent, GeoColor.FromArgb(100, GeoColor.SimpleColors.Green));worldLayer1.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; LayerOverlay staticOverlay = new LayerOverlay();staticOverlay.Layers.Add("WorldLayer", worldLayer);staticOverlay.Layers.Add("WorldLayer1", worldLayer1);winformsMap1.Overlays.Add("WorldOverlay", staticOverlay);            worldLayer.Open();winformsMap1.CurrentExtent = worldLayer.GetBoundingBox();//worldLayer.Close(); winformsMap1.Refresh();`  
  
&nbsp;  
&nbsp;  
&nbsp;  
Any&nbsp;more&nbsp;questions&nbsp;just&nbsp;feel&nbsp;free&nbsp;to&nbsp;let&nbsp;me&nbsp;know.  
&nbsp;  
Thanks.  
&nbsp;  
Yale
