1

How can I convert points from one projected coordinate system to another using ArcObjects in C#?

//Coordinates in feet
double feetLong = 2007816.711;
double feetLat = 393153.895;

//Coordinates in decimal degrees (Should be the resulting coordinates)
//long: -97.474575;
//lat:   32.747352;

double[] feetPair = new double[] { feetLong, feetLat };

//Our projection used in GIS
string epsg32038 = "PROJCS[\"NAD27 / Texas North Central\",GEOGCS[\"GCS_North_American_1927\",DATUM[\"D_North_American_1927\",SPHEROID[\"Clarke_1866\",6378206.4,294.9786982138982]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.017453292519943295]],PROJECTION[\"Lambert_Conformal_Conic\"],PARAMETER[\"standard_parallel_1\",32.13333333333333],PARAMETER[\"standard_parallel_2\",33.96666666666667],PARAMETER[\"latitude_of_origin\",31.66666666666667],PARAMETER[\"central_meridian\",-97.5],PARAMETER[\"false_easting\",2000000],PARAMETER[\"false_northing\",0],UNIT[\"Foot_US\",0.30480060960121924]]";
//Google Maps projection
string epsg3785 = "PROJCS[\"Popular Visualisation CRS / Mercator\",GEOGCS[\"Popular Visualisation CRS\",DATUM[\"D_Popular_Visualisation_Datum\",SPHEROID[\"Popular_Visualisation_Sphere\",6378137,0]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.017453292519943295]],PROJECTION[\"Mercator\"],PARAMETER[\"central_meridian\",0],PARAMETER[\"scale_factor\",1],PARAMETER[\"false_easting\",0],PARAMETER[\"false_northing\",0],UNIT[\"Meter\",1]]";

This is the beginning of my code. I've tried using the CoordinateSystemFactory but never got anything to work. I intend to use ProjNet to solve this although I am open to any other way. I am really new to using ArcObjects to create custom tools and have been stuck on this for a while.

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Surfinsanta
  • 43
  • 1
  • 7
  • I have edited your title. Please see, "[Should questions include “tags” in their titles?](http://meta.stackexchange.com/questions/19190/)", where the consensus is "no, they should not". – John Saunders Mar 26 '15 at 17:55
  • I think it's not very hard to do without using an API-call - here is a howto: http://www.ehow.com/how_5708473_convert-latitude-feet.html you just have to work backwards from there – Random Dev Mar 26 '15 at 17:58
  • Carsten, thanks for your reply. That conversion is very close but I don't think it's as precise as what I'm looking for (it was about 250ft off). – Surfinsanta Mar 26 '15 at 18:34
  • `//Define the projection the feet coordinates are obtained in ProjectionInfo startCoord = KnownCoordinateSystems.Projected.StatePlaneNad1927.NAD1927StatePlaneTexasNorthCentralFIPS4202; //Define the geographic coordinate system most web maps use ProjectionInfo endCoord = KnownCoordinateSystems.Geographic.World.WGS1984; //Calls the reproject function that will transform the input location to the output locaiton Reproject.ReprojectPoints(longLat, z, startCoord, endCoord, 0, 1);` – Surfinsanta Apr 01 '15 at 18:56
  • maybe [this example](https://www.codeproject.com/Tips/1072197/Coordinate-Transformation-Using-Proj-in-NET) which uses DotSpatial.Projections port of proj.4. – ToolmakerSteve Oct 23 '17 at 21:40

0 Answers0