Search code examples
algorithmgislatitude-longitude

How to convert UTM coordinates to Latitude and Longitude?


Duplicates:

My current project is interfacing with a central geocoding service published by the local city planning department. The service is designed primarily for surveying, and as such returns coordinates in a UTM X-Y format. My system stores coordinates as decimal latitude and longitude for integration with Google Earth and other mapping tools.

I'd like to come up with an algorithm for converting from X-Y to latitude and longitude for all cases. I have not been able to locate any texts describing the conversion; the most I've been able to find via Google is raw source code in the form of Excel Visual Basic and FORTRAN. I believe a useful general solution would be beneficial to the community at large.


Solution

  • You need a map projection library to do this.

    There are many libraries available that are open source. One of the most complete is PROJ.4.

    It is wrapped and used internally by many simpler libraries, such as GDAL.

    This will allow you to go from UTM->LatLon (with many options), UTM->State Plane, or from any common projection to any other common projection.