# Projections?

**URL:** <https://community.thinkgeo.com/t/projections/1552>\
**Category:** WinForms\
**Created:** [January 12, 2011, 10:46am UTC](https://community.thinkgeo.com/t/projections/1552 "2011-01-12T10:46:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aaron](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/a/e19adc/32.png) [@Aaron](https://community.thinkgeo.com/u/Aaron)\
**Post date:** [January 12, 2011, 10:46am UTC](https://community.thinkgeo.com/t/projections/1552/1 "2011-01-12T10:46:30Z")

</div>

Hi&nbsp;guys,

I&nbsp;have&nbsp;the&nbsp;following&nbsp;code&nbsp;

&nbsp;

WinformsMap1.MapUnit&nbsp;=&nbsp;GeographyUnit.Meter  
  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim&nbsp;Proj4&nbsp;As&nbsp;Proj4Projection&nbsp;=&nbsp;New&nbsp;Proj4Projection  
  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim&nbsp;minx&nbsp;As&nbsp;Double&nbsp;=&nbsp;7.5635861&nbsp;'Mininum&nbsp;Longitude  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim&nbsp;miny&nbsp;As&nbsp;Double&nbsp;=&nbsp;50.4159917&nbsp;'Minimum&nbsp;Latitude  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim&nbsp;maxx&nbsp;As&nbsp;Double&nbsp;=&nbsp;7.5672833&nbsp;'Maximum&nbsp;Longitude  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim&nbsp;maxy&nbsp;As&nbsp;Double&nbsp;=&nbsp;50.4195222&nbsp;'Maximum&nbsp;Latitude  
  
  
  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim&nbsp;googleMapsOverlay&nbsp;As&nbsp;New&nbsp;GoogleMapsOverlay()  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim&nbsp;stateOverlay&nbsp;As&nbsp;New&nbsp;LayerOverlay()  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dim&nbsp;layer&nbsp;As&nbsp;New&nbsp;ShapeFileFeatureLayer("BendorfTN\_line.shp")  
  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ShapeFileFeatureLayer.BuildIndexFile("BendorfTN\_line.shp")  
  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel&nbsp;=&nbsp;ApplyUntilZoomLevel.Level20  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;layer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle&nbsp;=&nbsp;New&nbsp;AreaStyle(New&nbsp;GeoPen(GeoColor.SimpleColors.Black),&nbsp;New&nbsp;GeoSolidBrush(GeoColor.SimpleColors.Yellow))  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;layer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle&nbsp;=&nbsp;New&nbsp;LineStyle(New&nbsp;GeoPen(GeoColor.SimpleColors.Black,&nbsp;1))  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;layer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle&nbsp;=&nbsp;New&nbsp;PointStyle(PointSymbolType.Circle,&nbsp;New&nbsp;GeoSolidBrush(GeoColor.SimpleColors.Green),&nbsp;10)  
  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Proj4.InternalProjectionParametersString&nbsp;=&nbsp;Proj4Projection.GetEpsgParametersString(4326)  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Proj4.ExternalProjectionParametersString&nbsp;=&nbsp;Proj4Projection.GetGoogleMapParametersString()  
  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Proj4.Open()  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WinformsMap1.CurrentExtent&nbsp;=&nbsp;Proj4.ConvertToExternalProjection(New&nbsp;RectangleShape(minx,&nbsp;maxy,&nbsp;maxx,&nbsp;miny))  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Proj4.Close()  
  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;layer.FeatureSource.Projection&nbsp;=&nbsp;Proj4  
  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;stateOverlay.Layers.Add("KmlLayer",&nbsp;layer)  
  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WinformsMap1.ZoomLevelSnapping&nbsp;=&nbsp;ZoomLevelSnappingMode.[Default]  
  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WinformsMap1.Overlays.Add(googleMapsOverlay)  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WinformsMap1.Overlays.Add("StateOverlay",&nbsp;stateOverlay)  
  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WinformsMap1.Refresh()

&nbsp;

&nbsp;

I&nbsp;want&nbsp;to&nbsp;also&nbsp;add&nbsp;a&nbsp;rotation&nbsp;to&nbsp;the&nbsp;projection,&nbsp;if&nbsp;i&nbsp;create&nbsp;a&nbsp;rotationprojection&nbsp;and&nbsp;then&nbsp;apply&nbsp;that&nbsp;to&nbsp;my&nbsp;shapefile&nbsp;layer&nbsp;i&nbsp;lose&nbsp;my&nbsp;shapefile&nbsp;because&nbsp;the&nbsp;projection&nbsp;that&nbsp;i&nbsp;previously&nbsp;applied&nbsp;has&nbsp;been&nbsp;overwritten&nbsp;with&nbsp;the&nbsp;rotation&nbsp;projection.&nbsp;

Does&nbsp;anyone&nbsp;know&nbsp;how&nbsp;i&nbsp;can&nbsp;apply&nbsp;my&nbsp;proj4projection&nbsp;and&nbsp;then&nbsp;add&nbsp;a&nbsp;rotation&nbsp;to&nbsp;that.

Thanks

Aaron

---

<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 12, 2011, 3:09pm UTC](https://community.thinkgeo.com/t/projections/1552/2 "2011-01-12T15:09:24Z")

</div>

You&nbsp;want&nbsp;to&nbsp;have&nbsp;a&nbsp;projection&nbsp;applied&nbsp;to&nbsp;a&nbsp;layer&nbsp;and&nbsp;then&nbsp;apply&nbsp;a&nbsp;rotation&nbsp;to&nbsp;it.&nbsp;That&nbsp;should&nbsp;be&nbsp;possible&nbsp;without&nbsp;major&nbsp;problem&nbsp;but&nbsp;I&nbsp;have&nbsp;some&nbsp;doubts&nbsp;based&nbsp;on&nbsp;the&nbsp;code&nbsp;that&nbsp;you&nbsp;posted.&nbsp;I&nbsp;see&nbsp;that&nbsp;you&nbsp;are&nbsp;using&nbsp;a&nbsp;Google&nbsp;Map&nbsp;overlay.&nbsp;Google&nbsp;Map&nbsp;cannot&nbsp;be&nbsp;rotated&nbsp;so&nbsp;if&nbsp;you&nbsp;apply&nbsp;a&nbsp;rotation&nbsp;to&nbsp;your&nbsp;layer&nbsp;it&nbsp;is&nbsp;not&nbsp;going&nbsp;to&nbsp;match&nbsp;with&nbsp;Google&nbsp;Map.&nbsp;I&nbsp;want&nbsp;you&nbsp;to&nbsp;be&nbsp;aware&nbsp;of&nbsp;that&nbsp;or,&nbsp;maybe,&nbsp;I&nbsp;don’t&nbsp;fully&nbsp;understand&nbsp;your&nbsp;case&nbsp;and&nbsp;if&nbsp;so,&nbsp;it&nbsp;would&nbsp;be&nbsp;good&nbsp;if&nbsp;you&nbsp;could&nbsp;give&nbsp;some&nbsp;more&nbsp;explanations&nbsp;of&nbsp;what&nbsp;you&nbsp;are&nbsp;trying&nbsp;to&nbsp;accomplish.&nbsp;Thank&nbsp;you.

---

<div class="post-metadata">

**Author:** ![Aaron](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/a/e19adc/32.png) [@Aaron](https://community.thinkgeo.com/u/Aaron)\
**Post date:** [January 13, 2011, 4:12am UTC](https://community.thinkgeo.com/t/projections/1552/3 "2011-01-13T04:12:34Z")

</div>

Val,

Thanks&nbsp;for&nbsp;your&nbsp;reply.&nbsp;The&nbsp;rotation&nbsp;i&nbsp;want&nbsp;to&nbsp;apply&nbsp;is&nbsp;to&nbsp;the&nbsp;shapefilefeaturelayer&nbsp;only,&nbsp;named&nbsp;in&nbsp;this&nbsp;case&nbsp;'layer'.&nbsp;i&nbsp;have&nbsp;a&nbsp;situation&nbsp;that&nbsp;requires&nbsp;a&nbsp;map&nbsp;to&nbsp;be&nbsp;displayed&nbsp;in&nbsp;a&nbsp;specified&nbsp;number&nbsp;of&nbsp;degrees&nbsp;from&nbsp;it's&nbsp;true&nbsp;orientation,&nbsp;once&nbsp;the&nbsp;google&nbsp;imagery&nbsp;is&nbsp;turned&nbsp;on&nbsp;the&nbsp;map&nbsp;will&nbsp;then&nbsp;be&nbsp;rotated&nbsp;to&nbsp;it's&nbsp;true&nbsp;orientation&nbsp;to&nbsp;match&nbsp;the&nbsp;google&nbsp;layer.&nbsp;

I&nbsp;understand&nbsp;that&nbsp;the&nbsp;code&nbsp;case&nbsp;that&nbsp;i&nbsp;have&nbsp;provided&nbsp;doesn't&nbsp;highlight&nbsp;this&nbsp;need&nbsp;exactly.&nbsp;The&nbsp;google&nbsp;imagery&nbsp;can&nbsp;for&nbsp;the&nbsp;most&nbsp;part&nbsp;be&nbsp;disregarded&nbsp;in&nbsp;the&nbsp;rotation&nbsp;action&nbsp;as&nbsp;i'm&nbsp;aware&nbsp;that&nbsp;this&nbsp;cannot&nbsp;be&nbsp;rotated.

You're&nbsp;initial&nbsp;understanding&nbsp;of&nbsp;the&nbsp;the&nbsp;problem **&nbsp;"You&nbsp;want&nbsp;to&nbsp;have&nbsp;a&nbsp;projection&nbsp;applied&nbsp;to&nbsp;a&nbsp;layer&nbsp;and&nbsp;then&nbsp;apply&nbsp;a&nbsp;rotation&nbsp;to&nbsp;it."** &nbsp;was&nbsp;totally&nbsp;correct&nbsp;and&nbsp;as&nbsp;you&nbsp;mentioned&nbsp;that&nbsp;this&nbsp;is&nbsp;possible,&nbsp;could&nbsp;provide&nbsp;a&nbsp;code&nbsp;sample&nbsp;on&nbsp;how&nbsp;to&nbsp;do&nbsp;this?&nbsp;it&nbsp;would&nbsp;help&nbsp;me&nbsp;greatly.

Thanks&nbsp;Again

Aaron

&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, 9:32am UTC](https://community.thinkgeo.com/t/projections/1552/4 "2011-01-13T09:32:44Z")

</div>

Aaron,&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;Ok,&nbsp;now&nbsp;I&nbsp;understand&nbsp;clearly&nbsp;what&nbsp;you&nbsp;expect.&nbsp;Tomorrow,&nbsp;we&nbsp;will&nbsp;provide&nbsp;you&nbsp;with&nbsp;the&nbsp;projection&nbsp;class&nbsp;that&nbsp;allows&nbsp;to&nbsp;project&nbsp;a&nbsp;layer&nbsp;from&nbsp;Geodetic&nbsp;(EPSG&nbsp;4326)&nbsp;to&nbsp;Spherical&nbsp;Mercator&nbsp;(Google&nbsp;Map&nbsp;projection)&nbsp;and&nbsp;do&nbsp;the&nbsp;rotation&nbsp;at&nbsp;the&nbsp;same&nbsp;time.&nbsp;Thank&nbsp;you.

---

<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 14, 2011, 12:39am UTC](https://community.thinkgeo.com/t/projections/1552/5 "2011-01-14T00:39:10Z")

</div>

Aaron,

We&nbsp;have&nbsp;created&nbsp;a&nbsp;Projection&nbsp;class&nbsp;like&nbsp;Val&nbsp;said.&nbsp;Please&nbsp;look&nbsp;at&nbsp;the&nbsp;attached&nbsp;file.

Let&nbsp;me&nbsp;know&nbsp;if&nbsp;you&nbsp;have&nbsp;questions.

Thanks,

James

[NewProjection.zip](https://community.thinkgeo.com/uploads/default/original/2X/2/2c29f2d08aede8a2c69c51dc9eac450f626dfc9a.zip) (773 Bytes)

---

<div class="post-metadata">

**Author:** ![Aaron](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/a/e19adc/32.png) [@Aaron](https://community.thinkgeo.com/u/Aaron)\
**Post date:** [January 14, 2011, 5:34am UTC](https://community.thinkgeo.com/t/projections/1552/6 "2011-01-14T05:34:31Z")

</div>

Hi&nbsp;guys,

I've&nbsp;tried&nbsp;to&nbsp;implement&nbsp;your&nbsp;solution&nbsp;but&nbsp;it's&nbsp;not&nbsp;having&nbsp;the&nbsp;effects&nbsp;that&nbsp;i&nbsp;would&nbsp;have&nbsp;assumed,&nbsp;where&nbsp;in&nbsp;the&nbsp;past&nbsp;i've&nbsp;added&nbsp;a&nbsp;rotation&nbsp;the&nbsp;map&nbsp;has&nbsp;rotated&nbsp;about&nbsp;a&nbsp;single&nbsp;point&nbsp;which&nbsp;is&nbsp;what&nbsp;i&nbsp;assumed&nbsp;would&nbsp;be&nbsp;the&nbsp;case&nbsp;in&nbsp;this&nbsp;instance.&nbsp;

However,&nbsp;when&nbsp;i&nbsp;run&nbsp;the&nbsp;application&nbsp;and&nbsp;apply&nbsp;a&nbsp;rotation&nbsp;my&nbsp;map&nbsp;moves&nbsp;to&nbsp;a&nbsp;new&nbsp;location&nbsp;.&nbsp;

i&nbsp;also&nbsp;have&nbsp;a&nbsp;strange&nbsp;error&nbsp;of&nbsp;the&nbsp;map&nbsp;dissapearing&nbsp;when&nbsp;i&nbsp;get&nbsp;to&nbsp;a&nbsp;specific&nbsp;zoom&nbsp;level?

Perhaps&nbsp;i'm&nbsp;missing&nbsp;something&nbsp;obvious&nbsp;here&nbsp;as&nbsp;this&nbsp;is&nbsp;a&nbsp;little&nbsp;new&nbsp;to&nbsp;me.

I'm&nbsp;going&nbsp;to&nbsp;open&nbsp;a&nbsp;ticket&nbsp;in&nbsp;the&nbsp;customer&nbsp;support&nbsp;as&nbsp;it's&nbsp;much&nbsp;easier&nbsp;for&nbsp;me&nbsp;to&nbsp;upload&nbsp;all&nbsp;of&nbsp;my&nbsp;data&nbsp;for&nbsp;yourselves&nbsp;so&nbsp;that&nbsp;you&nbsp;can&nbsp;see&nbsp;clearer&nbsp;what&nbsp;is&nbsp;going&nbsp;on&nbsp;in&nbsp;this&nbsp;specific&nbsp;case.

Once&nbsp;the&nbsp;issue&nbsp;has&nbsp;been&nbsp;resolved&nbsp;i'll&nbsp;post&nbsp;a&nbsp;response&nbsp;here&nbsp;incase&nbsp;anyone&nbsp;else&nbsp;needs&nbsp;it&nbsp;in&nbsp;the&nbsp;future.

&nbsp;

Thanks&nbsp;for&nbsp;the&nbsp;initial&nbsp;help.

Aaron

---

<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 14, 2011, 10:20am UTC](https://community.thinkgeo.com/t/projections/1552/7 "2011-01-14T10:20:55Z")

</div>

Aaron,&nbsp;  
&nbsp;&nbsp;  
&nbsp;&nbsp;I&nbsp;just&nbsp;got&nbsp;assigned&nbsp;the&nbsp;support&nbsp;ticket&nbsp;related&nbsp;to&nbsp;your&nbsp;issue.&nbsp;We&nbsp;will&nbsp;work&nbsp;from&nbsp;that&nbsp;ticket&nbsp;and&nbsp;once&nbsp;we&nbsp;have&nbsp;the&nbsp;complete&nbsp;solution,&nbsp;we&nbsp;will&nbsp;show&nbsp;it&nbsp;on&nbsp;this&nbsp;post&nbsp;for&nbsp;everybody&nbsp;to&nbsp;take&nbsp;advantage&nbsp;of.
