# Reprojecting a feature in Google Mercator to feature in EPSG 4326?

**URL:** <https://community.thinkgeo.com/t/reprojecting-a-feature-in-google-mercator-to-feature-in-epsg-4326/1867>\
**Category:** WinForms\
**Created:** [December 15, 2011, 7:50am UTC](https://community.thinkgeo.com/t/reprojecting-a-feature-in-google-mercator-to-feature-in-epsg-4326/1867 "2011-12-15T07:50:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bennie](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/b/85f322/32.png) [@Bennie](https://community.thinkgeo.com/u/Bennie)\
**Post date:** [December 15, 2011, 7:50am UTC](https://community.thinkgeo.com/t/reprojecting-a-feature-in-google-mercator-to-feature-in-epsg-4326/1867/1 "2011-12-15T07:50:30Z")

</div>

&nbsp;Hi&nbsp;All,

How&nbsp;do&nbsp;you&nbsp;reproject&nbsp;a&nbsp;feature&nbsp;that&nbsp;is&nbsp;in&nbsp;google&nbsp;mercator&nbsp;in&nbsp;metres&nbsp;to&nbsp;EPSG&nbsp;4236&nbsp;decimal&nbsp;degress?

I&nbsp;know&nbsp;you&nbsp;can&nbsp;reproject&nbsp;the&nbsp;other&nbsp;way&nbsp;around&nbsp;by&nbsp;using:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Proj4Projection&nbsp;proj4Projection&nbsp;=&nbsp;new&nbsp;Proj4Projection();

&nbsp;&nbsp;proj4Projection.InternalProjectionParametersString&nbsp;=&nbsp;Proj4Projection.GetGoogleMapParametersString();  
&nbsp;&nbsp;proj4Projection.ExternalProjectionParametersString&nbsp;=&nbsp;Proj4Projection.GetEpsgParametersString(4326);  
  
&nbsp;  
&nbsp;&nbsp;proj4Projection.Open();  
&nbsp;&nbsp;Feature&nbsp;geoFeature&nbsp;=&nbsp;proj4Projection.ConvertToExternalProjection(geomShape);  
&nbsp;&nbsp;proj4Projection.Close();  
  
  
  
But&nbsp;can&nbsp;I&nbsp;do&nbsp;the&nbsp;reverse?  
  
  
  
Thanks  
  
  
  
Bennie

---

<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:** [December 15, 2011, 3:48pm UTC](https://community.thinkgeo.com/t/reprojecting-a-feature-in-google-mercator-to-feature-in-epsg-4326/1867/2 "2011-12-15T15:48:32Z")

</div>

Bennie,

&nbsp;&nbsp;With&nbsp;Proj4Projection,&nbsp;you&nbsp;can&nbsp;go&nbsp;from&nbsp;one&nbsp;projection&nbsp;to&nbsp;another&nbsp;and&nbsp;vice&nbsp;versa.&nbsp;First,&nbsp;you&nbsp;need&nbsp;to&nbsp;know&nbsp;how&nbsp;you&nbsp;set&nbsp;the&nbsp;internal&nbsp;and&nbsp;the&nbsp;external&nbsp;projection.&nbsp;You&nbsp;have&nbsp;to&nbsp;think&nbsp;logically&nbsp;about&nbsp;your&nbsp;internal&nbsp;and&nbsp;external&nbsp;projections&nbsp;and&nbsp;use&nbsp;the&nbsp;ConvertToInternalProjection&nbsp;or&nbsp;the&nbsp;ConvertToExternalProjection&nbsp;to&nbsp;go&nbsp;one&nbsp;way&nbsp;or&nbsp;another.

I&nbsp;recommend&nbsp;you&nbsp;look&nbsp;at&nbsp;the&nbsp;sample&nbsp;GPS&nbsp;to&nbsp;Google&nbsp;Map&nbsp;[wiki.thinkgeo.com/wiki/Map\_Suite\_De...Desktop.29](http://wiki.thinkgeo.com/wiki/Map_Suite_Desktop_Edition_All_Samples#GPS_to_Google_Map.28Desktop.29).&nbsp;You&nbsp;will&nbsp;a&nbsp;very&nbsp;good&nbsp;and&nbsp;common&nbsp;example&nbsp;on&nbsp;how&nbsp;to&nbsp;go&nbsp;from&nbsp;decimal&nbsp;degrees&nbsp;to&nbsp;Google&nbsp;Map.

&nbsp;

`//Sets the projection parameters to go from Geodetic (EPSG 4326) or decimal degrees to Google Map projection (Spherical Mercator).Proj4Projection proj4 = new Proj4Projection();proj4.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326);proj4.ExternalProjectionParametersString = Proj4Projection.GetGoogleMapParametersString();proj4.Open();//Here we go from decimal degrees to Google Map projectionVertex projVertex = proj4.ConvertToExternalProjection(Longitude, Latitude);//Here we go from Google Map projection to decimnal degreesVertex decimalDegreesVertex = proj4.ConvertToInternalProjection(projVertex.X, projVertex.Y);proj4.Close();`

---

<div class="post-metadata">

**Author:** ![Bennie](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/b/85f322/32.png) [@Bennie](https://community.thinkgeo.com/u/Bennie)\
**Post date:** [December 16, 2011, 3:02am UTC](https://community.thinkgeo.com/t/reprojecting-a-feature-in-google-mercator-to-feature-in-epsg-4326/1867/3 "2011-12-16T03:02:46Z")

</div>

&nbsp;Thanks&nbsp;Val,&nbsp;it&nbsp;works&nbsp;great,&nbsp;I&nbsp;think&nbsp;seeing&nbsp;the&nbsp;param&nbsp;hint&nbsp;in&nbsp;the&nbsp;code&nbsp;completion&nbsp;referencing&nbsp;decimal&nbsp;degress&nbsp;through&nbsp;me&nbsp;of&nbsp;the&nbsp;right&nbsp;path&nbsp;a&nbsp;bit.

&nbsp;

&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Parameters:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;feature:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This&nbsp;parameter&nbsp;is&nbsp;the&nbsp;Feature&nbsp;that&nbsp;contains&nbsp;a&nbsp;BaseShape&nbsp;in&nbsp;decimalDegreesValue  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;be&nbsp;projected.  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;&nbsp;Thanks&nbsp;for&nbsp;your&nbsp;help&nbsp;&nbsp;Bennie

---

<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:** [December 16, 2011, 10:06am UTC](https://community.thinkgeo.com/t/reprojecting-a-feature-in-google-mercator-to-feature-in-epsg-4326/1867/4 "2011-12-16T10:06:13Z")

</div>

Bennie,

&nbsp;I&nbsp;am&nbsp;glad&nbsp;I&nbsp;pointed&nbsp;you&nbsp;out&nbsp;to&nbsp;the&nbsp;right&nbsp;direction&nbsp;on&nbsp;this&nbsp;projection&nbsp;issue.&nbsp;If&nbsp;you&nbsp;have&nbsp;more&nbsp;questions,&nbsp;let&nbsp;us&nbsp;know.
