Search code examples
c#arcgisesri

Convert UTM to decimal degrees with Esri's ArcGis with C#


I need to convert a user's UTM input (WGS 1984) into Decimal Degrees, preferably using ESRI's ArcGis. I've already got the code to retrieve the zone (formatted like 14N, 22S, etc.) and the easting and northing factors. What do I do from here?

Edit: we expect the input as a string like: 14N 423113mE 4192417mN. I can easily extract the numbers (and a character) 14, N, 423113, and 4192417 from the string above. I just need to somehow translate that to Decimal Degrees.


Solution

  • There is no specific information about input data.

    Here is some general info to start from:

    1. The easiest way is to use Geoprocessing engine to reproject the whole feature class. Use C# class for Project tool from Data Management toolbox.
    2. Another way is to use Project method of IGeometry is you want project only several features.

    EDIT: for your input data use solution 2.

    One more easier way is to use .NET port of open-source library Proj.4 - Proj4Net. For such simple task it is much more easier to use than ArcObjects classes.