# Projection problems

**URL:** <https://community.thinkgeo.com/t/projection-problems/5645>\
**Category:** WebForms\
**Created:** [January 13, 2011, 10:17am UTC](https://community.thinkgeo.com/t/projection-problems/5645 "2011-01-13T10:17:54Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leon](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/l/dc4da7/32.png) [@Leon](https://community.thinkgeo.com/u/Leon)\
**Post date:** [January 13, 2011, 10:17am UTC](https://community.thinkgeo.com/t/projection-problems/5645/1 "2011-01-13T10:17:54Z")

</div>

Hello,

I&nbsp;am&nbsp;trying&nbsp;to&nbsp;add&nbsp;a&nbsp;shapefile&nbsp;to&nbsp;a&nbsp;one&nbsp;of&nbsp;my&nbsp;maps.&nbsp;&nbsp;I&nbsp;got&nbsp;the&nbsp;Shapefile&nbsp;form&nbsp;the&nbsp;State&nbsp;of&nbsp;Oregon.&nbsp;&nbsp;Its&nbsp;an&nbsp;Shapefile&nbsp;containing&nbsp;the&nbsp;political&nbsp;districts,&nbsp;one&nbsp;for&nbsp;the&nbsp;state&nbsp;house&nbsp;and&nbsp;one&nbsp;for&nbsp;the&nbsp;state&nbsp;senate.&nbsp;&nbsp;Looking&nbsp;in&nbsp;the&nbsp;XML&nbsp;file&nbsp;that&nbsp;came&nbsp;with&nbsp;the&nbsp;shapefile,&nbsp;it&nbsp;appears&nbsp;to&nbsp;be&nbsp;NAD83&nbsp;Lamebert&nbsp;Conformal&nbsp;Conical&nbsp;projection.&nbsp;&nbsp;I&nbsp;tried&nbsp;making&nbsp;a&nbsp;striped&nbsp;down&nbsp;project&nbsp;that&nbsp;jsut&nbsp;loads&nbsp;the&nbsp;shapefile.&nbsp;&nbsp;I&nbsp;was&nbsp;not&nbsp;able&nbsp;to&nbsp;display&nbsp;it&nbsp;in&nbsp;feet,&nbsp;meters&nbsp;or&nbsp;decimaldegree&nbsp;as&nbsp;mapunits.&nbsp;&nbsp;I&nbsp;made&nbsp;a&nbsp;projection&nbsp;object&nbsp;and&nbsp;tried&nbsp;to&nbsp;project&nbsp;it.&nbsp;&nbsp;I&nbsp;am&nbsp;familar&nbsp;with&nbsp;using&nbsp;your&nbsp;projection&nbsp;object.&nbsp;&nbsp;I&nbsp;have&nbsp;been&nbsp;using&nbsp;it&nbsp;successfully.

&nbsp;

`ManagedProj4Projection proj4 = new ManagedProj4Projection();            proj4.InternalProjectionParameters = ManagedProj4Projection.GetEpsgParameters(4326);            proj4.ExternalProjectionParameters = ManagedProj4Projection.GetGoogleMapParameters();            ManagedProj4Projection proj5 = new ManagedProj4Projection();            proj5.InternalProjectionParameters = ManagedProj4Projection.GetEpsgParameters(2226);            proj5.ExternalProjectionParameters = ManagedProj4Projection.GetGoogleMapParameters();`

I&nbsp;guess&nbsp;what&nbsp;I&nbsp;need&nbsp;to&nbsp;know&nbsp;is&nbsp;the&nbsp;code&nbsp;for&nbsp;this&nbsp;projection.&nbsp;&nbsp;I&nbsp;did&nbsp;some&nbsp;research&nbsp;and&nbsp;it&nbsp;look&nbsp;slike&nbsp;I&nbsp;should&nbsp;be&nbsp;using&nbsp;2991&nbsp;or&nbsp;2992.&nbsp;&nbsp;Both&nbsp;of&nbsp;which&nbsp;did&nbsp;not&nbsp;work.&nbsp;&nbsp;I&nbsp;also&nbsp;tried&nbsp;just&nbsp;epsg&nbsp;83&nbsp;and&nbsp;8901&nbsp;which&nbsp;also&nbsp;didnt&nbsp;work.

Any&nbsp;ideas.&nbsp;&nbsp;I&nbsp;am&nbsp;attaching&nbsp;a&nbsp;screenshot&nbsp;of&nbsp;the&nbsp;XML&nbsp;for&nbsp;the&nbsp;shapefile&nbsp;that&nbsp;contains&nbsp;the&nbsp;projection&nbsp;information.

 ![](https://community.thinkgeo.com/uploads/default/original/1X/25f35603f714c1f5b7005ef5a7e5632eb7d7c00b.png)

Thanks,

Leon

&nbsp;

---

<div class="post-metadata">

**Author:** ![Val](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/v/e56c9b/32.png) [@Val](https://community.thinkgeo.com/u/Val)\
**Post date:** [January 13, 2011, 2:30pm UTC](https://community.thinkgeo.com/t/projection-problems/5645/2 "2011-01-13T14:30:46Z")

</div>

Leon,

&nbsp;I&nbsp;did&nbsp;a&nbsp;search&nbsp;in&nbsp;[spatial-reference.org](http://www.spatial-reference.org)&nbsp;to&nbsp;see&nbsp;if&nbsp;there&nbsp;is&nbsp;a&nbsp;standard&nbsp;projection&nbsp;used&nbsp;for&nbsp;Oregon.&nbsp;The&nbsp;closest&nbsp;thing&nbsp;I&nbsp;could&nbsp;find&nbsp;according&nbsp;to&nbsp;the&nbsp;parameters&nbsp;I&nbsp;saw&nbsp;in&nbsp;your&nbsp;XML&nbsp;is&nbsp;EPSG&nbsp;2992&nbsp;[spatial-reference.org/ref/epsg/2992/proj4/](http://www.spatial-reference.org/ref/epsg/3644/proj4/)&nbsp;as&nbsp;you&nbsp;did.&nbsp;But&nbsp;i&nbsp;notice&nbsp;that&nbsp;the&nbsp;false&nbsp;easting&nbsp;parameters&nbsp;is&nbsp;different:&nbsp;

+proj=lcc&nbsp;+lat\_1=43&nbsp;+lat\_2=45.5&nbsp;+lat\_0=41.75&nbsp;+lon\_0=-120.5&nbsp;+x\_0=399999.9999984&nbsp;+y\_0=0&nbsp;+ellps=GRS80&nbsp;+datum=NAD83&nbsp;+to\_meter=0.3048&nbsp;+no\_defs&nbsp;

So,&nbsp;I&nbsp;would&nbsp;try&nbsp;&nbsp;the&nbsp;following&nbsp;string&nbsp;with&nbsp;the&nbsp;change&nbsp;in&nbsp;the&nbsp;false&nbsp;easting&nbsp;value:

+proj=lcc&nbsp;+lat\_1=43&nbsp;+lat\_2=45.5&nbsp;+lat\_0=41.75&nbsp;+lon\_0=-120.5&nbsp;+x\_0=1312336&nbsp;+y\_0=0&nbsp;+ellps=GRS80&nbsp;+datum=NAD83&nbsp;+to\_meter=0.3048&nbsp;+no\_defs&nbsp;

&nbsp;If&nbsp;you&nbsp;are&nbsp;still&nbsp;having&nbsp;trouble,&nbsp;you&nbsp;would&nbsp;need&nbsp;to&nbsp;send&nbsp;us&nbsp;the&nbsp;shapefile&nbsp;itself&nbsp;so&nbsp;that&nbsp;we&nbsp;can&nbsp;test&nbsp;directly&nbsp;on&nbsp;it.&nbsp;Thank&nbsp;you.

---

<div class="post-metadata">

**Author:** ![Leon](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/l/dc4da7/32.png) [@Leon](https://community.thinkgeo.com/u/Leon)\
**Post date:** [January 14, 2011, 1:12pm UTC](https://community.thinkgeo.com/t/projection-problems/5645/3 "2011-01-14T13:12:15Z")

</div>

Thanks&nbsp;for&nbsp;the&nbsp;reply&nbsp;Val,

How&nbsp;would&nbsp;I&nbsp;code&nbsp;that&nbsp;string&nbsp;into&nbsp;a&nbsp;projection?

+proj=lcc&nbsp;+lat\_1=43&nbsp;+lat\_2=45.5&nbsp;+lat\_0=41.75&nbsp;+lon\_0=-120.5&nbsp;+x\_0=1312336&nbsp;+y\_0=0&nbsp;+ellps=GRS80&nbsp;+datum=NAD83&nbsp;+to\_meter=0.3048&nbsp;+no\_defs&nbsp;

Here&nbsp;is&nbsp;the&nbsp;code&nbsp;for&nbsp;my&nbsp;basic&nbsp;page&nbsp;that&nbsp;I&nbsp;am&nbsp;using&nbsp;to&nbsp;try&nbsp;and&nbsp;see&nbsp;the&nbsp;shapefile.

&nbsp;

Thanks&nbsp;for&nbsp;your&nbsp;help,

Leon

&nbsp;

` //Setting up the Map                Map1.MapBackground.BackgroundBrush = new GeoSolidBrush(GeoColor.FromHtml("#E5E3DF"));                //Map1.CurrentExtent = new RectangleShape(-118.19, 34.8, -117.6, 32.7);                Map1.MapUnit = GeographyUnit.DecimalDegree;                Map1.MapTools.MeasureMapTool.Enabled = true;                Map1.MapTools.MeasureMapTool.MeasureType = MeasureType.None;                Map1.MapTools.AnimationPanMapTool.Enabled = true;                ManagedProj4Projection proj6 = new ManagedProj4Projection();                proj6.InternalProjectionParameters = ManagedProj4Projection.GetEpsgParameters(2992);                proj6.ExternalProjectionParameters = ManagedProj4Projection.GetEpsgParameters(4326);                ShapeFileFeatureLayer layer2 = new ShapeFileFeatureLayer(MapPath("app_data/2000house_districts.shp"));                ShapeFileFeatureLayer.BuildIndexFile(MapPath("app_data/2000house_districts.shp"));                layer2.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = LineStyles.Canal1;                layer2.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;                layer2.FeatureSource.Projection = proj6;                //Define a Layer Overlay object                LayerOverlay ShapeFiles1 = new LayerOverlay();                ShapeFiles1.IsBaseOverlay = false;                //Add the Shape Layer to the Layer Overlay Object                //ShapeFiles1.Layers.Add(layer1);                ShapeFiles1.Layers.Add(layer2);                                Map1.CustomOverlays.Add(ShapeFiles1);`

---

<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:** [January 16, 2011, 9:11pm UTC](https://community.thinkgeo.com/t/projection-problems/5645/4 "2011-01-16T21:11:33Z")

</div>

Leon,

Please&nbsp;try&nbsp;this&nbsp;code:

`ManagedProj4Projection proj6 = new ManagedProj4Projection();proj6.InternalProjectionParameters = "+proj=lcc +lat_1=43 +lat_2=45.5 +lat_0=41.75 +lon_0=-120.5 +x_0=1312336 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048 +no_defs"; proj6.ExternalProjectionParameters = ManagedProj4Projection.GetEpsgParameters(4326);`

Thanks,

James

---

<div class="post-metadata">

**Author:** ![Leon](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/l/dc4da7/32.png) [@Leon](https://community.thinkgeo.com/u/Leon)\
**Post date:** [January 19, 2011, 2:03pm UTC](https://community.thinkgeo.com/t/projection-problems/5645/5 "2011-01-19T14:03:05Z")

</div>

Hi&nbsp;James,

thanks&nbsp;for&nbsp;your&nbsp;help.&nbsp;&nbsp;I&nbsp;did&nbsp;not&nbsp;realize&nbsp;that&nbsp;you&nbsp;could&nbsp;put&nbsp;the&nbsp;projection&nbsp;information&nbsp;directly&nbsp;into&nbsp;the&nbsp;object&nbsp;as&nbsp;a&nbsp;string.

I&nbsp;tried&nbsp;your&nbsp;code&nbsp;snippet&nbsp;but&nbsp;its&nbsp;not&nbsp;working.&nbsp;&nbsp;I&nbsp;am&nbsp;attaching&nbsp;the&nbsp;shapefile&nbsp;that&nbsp;I&nbsp;got&nbsp;from&nbsp;the&nbsp;Oregon&nbsp;state&nbsp;website.&nbsp;&nbsp;Could&nbsp;you&nbsp;please&nbsp;look&nbsp;at&nbsp;it.&nbsp;&nbsp;I&nbsp;think&nbsp;there&nbsp;must&nbsp;be&nbsp;something&nbsp;I&nbsp;am&nbsp;missing&nbsp;or&nbsp;the&nbsp;shapefile&nbsp;is&nbsp;bad.

thanks

I&nbsp;can&nbsp;not&nbsp;attach&nbsp;the&nbsp;zip&nbsp;file&nbsp;because&nbsp;it&nbsp;is&nbsp;over&nbsp;500kb.&nbsp;&nbsp;I&nbsp;am&nbsp;posting&nbsp;the&nbsp;link&nbsp;to&nbsp;the&nbsp;website&nbsp;where&nbsp;I&nbsp;got&nbsp;the&nbsp;file

[sos.state.or.us/election...eshape.zip](http://www.sos.state.or.us/elections/DistrictMaps/HouseMaps/houseshape.zip)

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![Val](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/v/e56c9b/32.png) [@Val](https://community.thinkgeo.com/u/Val)\
**Post date:** [January 19, 2011, 4:06pm UTC](https://community.thinkgeo.com/t/projection-problems/5645/6 "2011-01-19T16:06:15Z")

</div>

Leon,&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;We&nbsp;will&nbsp;look&nbsp;at&nbsp;that&nbsp;Oregon&nbsp;data&nbsp;tomorrow.&nbsp;Thank&nbsp;you&nbsp;for&nbsp;your&nbsp;interest&nbsp;in&nbsp;Map&nbsp;Suite.

---

<div class="post-metadata">

**Author:** ![Val](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/v/e56c9b/32.png) [@Val](https://community.thinkgeo.com/u/Val)\
**Post date:** [January 20, 2011, 3:54pm UTC](https://community.thinkgeo.com/t/projection-problems/5645/7 "2011-01-20T15:54:25Z")

</div>

Leon,&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;I&nbsp;am&nbsp;still&nbsp;working&nbsp;on&nbsp;this.&nbsp;You&nbsp;should&nbsp;have&nbsp;an&nbsp;answer&nbsp;tomorrow&nbsp;morning.&nbsp;Thank&nbsp;you&nbsp;for&nbsp;your&nbsp;patience.

---

<div class="post-metadata">

**Author:** ![Leon](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/l/dc4da7/32.png) [@Leon](https://community.thinkgeo.com/u/Leon)\
**Post date:** [January 20, 2011, 4:09pm UTC](https://community.thinkgeo.com/t/projection-problems/5645/8 "2011-01-20T16:09:51Z")

</div>

Thank&nbsp;you&nbsp;Val,&nbsp;I&nbsp;appreciate&nbsp;your&nbsp;assistance.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Leon

---

<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:** [January 20, 2011, 11:31pm UTC](https://community.thinkgeo.com/t/projection-problems/5645/9 "2011-01-20T23:31:11Z")

</div>

Leon,

I&nbsp;reviewed&nbsp;all&nbsp;of&nbsp;the&nbsp;comments&nbsp;above&nbsp;and&nbsp;I&nbsp;checked&nbsp;the&nbsp;shape&nbsp;files&nbsp;what&nbsp;you&nbsp;attached,&nbsp;I&nbsp;found&nbsp;out&nbsp;a&nbsp;problem&nbsp;in&nbsp;your&nbsp;code,&nbsp;actually,&nbsp;your&nbsp;shape&nbsp;file&nbsp;is&nbsp;the&nbsp;multi&nbsp;polygon&nbsp;shapes,&nbsp;but&nbsp;you&nbsp;render&nbsp;it&nbsp;used&nbsp;the&nbsp;line&nbsp;style,&nbsp;obviously,&nbsp;the&nbsp;shape&nbsp;file&nbsp;cannot&nbsp;be&nbsp;displayed&nbsp;correctly&nbsp;whatever&nbsp;the&nbsp;mapunit,&nbsp;please&nbsp;use&nbsp;the&nbsp;following&nbsp;code&nbsp;to&nbsp;try&nbsp;again&nbsp;with&nbsp;your&nbsp;shape&nbsp;file:

` //Setting up the Map                Map1.MapBackground.BackgroundBrush = new GeoSolidBrush(GeoColor.FromHtml("#E5E3DF"));                Map1.MapUnit = GeographyUnit.Feet;                Map1.MapTools.MeasureMapTool.Enabled = true;                Map1.MapTools.MeasureMapTool.MeasureType = MeasureType.None;                Map1.MapTools.AnimationPanMapTool.Enabled = true;                ShapeFileFeatureLayer layer2 = new ShapeFileFeatureLayer(MapPath("app_data/2000house_districts.shp"));                layer2.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1;                layer2.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;                layer2.Open();                Map1.CurrentExtent = layer2.GetBoundingBox();                layer2.Close();                //Define a Layer Overlay object                LayerOverlay ShapeFiles1 = new LayerOverlay();                ShapeFiles1.IsBaseOverlay = false;                ShapeFiles1.Layers.Add(layer2);                Map1.CustomOverlays.Add(ShapeFiles1);`You&nbsp;can&nbsp;see&nbsp;I&nbsp;didn't&nbsp;use&nbsp;any&nbsp;code&nbsp;for&nbsp;projection,&nbsp;I&nbsp;just&nbsp;set&nbsp;the&nbsp;mapunit&nbsp;to&nbsp;Feet&nbsp;and&nbsp;change&nbsp;the&nbsp;line&nbsp;style&nbsp;to&nbsp;area&nbsp;style&nbsp;then&nbsp;the&nbsp;shape&nbsp;file&nbsp;can&nbsp;be&nbsp;displayed&nbsp;correctly,&nbsp;according&nbsp;to&nbsp;your&nbsp;first&nbsp;comment,&nbsp;I&nbsp;think&nbsp;this&nbsp;is&nbsp;your&nbsp;real&nbsp;problem,

If&nbsp;you&nbsp;still&nbsp;have&nbsp;any&nbsp;other&nbsp;questions&nbsp;please&nbsp;let&nbsp;us&nbsp;know,

Thanks,

Scott,

---

<div class="post-metadata">

**Author:** ![Leon](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/l/dc4da7/32.png) [@Leon](https://community.thinkgeo.com/u/Leon)\
**Post date:** [January 21, 2011, 11:12am UTC](https://community.thinkgeo.com/t/projection-problems/5645/10 "2011-01-21T11:12:32Z")

</div>

Oh&nbsp;wow!!&nbsp;&nbsp;how&nbsp;did&nbsp;I&nbsp;miss&nbsp;that&nbsp;one.&nbsp;&nbsp;Ok&nbsp;now&nbsp;that&nbsp;is&nbsp;embarassing.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Thanks&nbsp;to&nbsp;everyone&nbsp;who&nbsp;replied&nbsp;to&nbsp;this&nbsp;ticket.&nbsp;&nbsp;I&nbsp;appreciate&nbsp;everyone’s&nbsp;help&nbsp;and&nbsp;for&nbsp;pointing&nbsp;out&nbsp;my&nbsp;mistake.&nbsp;  
&nbsp;&nbsp;  
&nbsp;Leon

---

<div class="post-metadata">

**Author:** ![Val](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/v/e56c9b/32.png) [@Val](https://community.thinkgeo.com/u/Val)\
**Post date:** [January 21, 2011, 3:02pm UTC](https://community.thinkgeo.com/t/projection-problems/5645/11 "2011-01-21T15:02:54Z")

</div>

Leon,

&nbsp;I&nbsp;am&nbsp;glad&nbsp;Scott&nbsp;helped&nbsp;you&nbsp;solve&nbsp;the&nbsp;style&nbsp;problem.

I&nbsp;would&nbsp;like&nbsp;to&nbsp;bring&nbsp;the&nbsp;projection&nbsp;issue&nbsp;you&nbsp;are&nbsp;having&nbsp;and&nbsp;bring&nbsp;one&nbsp;correction.&nbsp;For&nbsp;the&nbsp;internal&nbsp;projection&nbsp;parameters,&nbsp;you&nbsp;have&nbsp;to&nbsp;pass&nbsp;a&nbsp;string&nbsp;due&nbsp;to&nbsp;the&nbsp;custom&nbsp;parameters&nbsp;used&nbsp;for&nbsp;the&nbsp;Oregon&nbsp;projection.&nbsp;The&nbsp;false&nbsp;Easting&nbsp;is&nbsp;always&nbsp;expressed&nbsp;in&nbsp;meters&nbsp;in&nbsp;the&nbsp;Proj4&nbsp;string,&nbsp;as&nbsp;opposed&nbsp;to&nbsp;the&nbsp;prj&nbsp;file&nbsp;were&nbsp;it&nbsp;can&nbsp;be&nbsp;expressed&nbsp;in&nbsp;feet.&nbsp;So&nbsp;the&nbsp;false&nbsp;easting&nbsp;is&nbsp;going&nbsp;to&nbsp;be&nbsp;400&nbsp;000&nbsp;(not&nbsp;1&nbsp;312&nbsp;336).

"+proj=lcc&nbsp;+lat\_1=43&nbsp;+lat\_2=45.5&nbsp;+lat\_0=41.75&nbsp;+lon\_0=-120.5&nbsp; **+x\_0=400000&nbsp;** +y\_0=0&nbsp;+ellps=GRS80&nbsp;+datum=NAD83&nbsp;+to\_meter=0.3048&nbsp;+no\_defs"

;

And&nbsp;I&nbsp;could&nbsp;display&nbsp;fine&nbsp;your&nbsp;shapefile&nbsp;on&nbsp;the&nbsp;WorldMapKit.&nbsp;See&nbsp;the&nbsp;screen&nbsp;shot&nbsp;below:

 ![](https://community.thinkgeo.com/uploads/default/original/2X/e/ed9e68c3b3aa7bfcc8e7e4f0e9266fc73cb43706.jpg)
