views:

784

answers:

4

Hi stackoverflow,

I've been searching for a while now (here and on google obviously) for a neat way to convert a set of UTM coords to Latitude and Longitude. I've got the coords and I know in what zone they are, but how do I convert this to lat and lon? Was hoping there would be some kind of a class that could do at least some of the magic for me, but it dosn't seem so :(

Any suggestions on this?

I know it can be done, as this converter seems to work just fine:

http://home.hiwaay.net/~taylorc/toolbox/geography/geoutm.html

Any input is greatly appreciated! :)

Thanks!

+1  A: 

Take a look at this .NET library http://projnet.codeplex.com/ . This should help in your case

Gart
+1  A: 

If you want to roll your own functions, you can find a lot of useful information in this page:

http://www.colorado.edu/geography/gcraft/notes/coordsys/coordsys.html

I have a couple of functions to convert between lat-lon and UTM (both ways), but they are a bit long to write here.

Gorpik
A: 

hello can u send the function to convert long and latit to UTM in my mail [email protected] and specila thhxxxxxxxxxxxxxxxxxxxxxx

ashraf elhakim
Hi ashraf, I didn't find a good solution to this sadly :( So I had to make a nasty workaround where I'm calling the bing geocode service for each address that I had in the database to get the lat and lon.Absolutely not a pretty approach, but as it worked because of the few records in the database. This approach is NOT recommended if you have 100+ records ;)
bomortensen
A: 

There is c++ code available on this website: http://www.gpsy.com/gpsinfo/geotoutm/

Go down the page a bit to the "Source Code" heading, and look for these files at the bottom:

Chuck Gantz

Enclosures: LatLong-UTMconversion.cpp (view online as text file) LatLong-UTMconversion.h (view online as text file) UTMConversions.cpp (view online as text file) SwissGrid.cpp (view online as text file) constants.h (view online as text file)

e.g. the first file links to: www.gpsy.com/gpsinfo/geotoutm/gantz/LatLong-UTMconversion.cpp etc

There are functions here for going both ways: UTM to Lat Long, and vice versa. If you look elsewhere, there are python versions of this code. e.g. at code.google.com/p/pys60gps/source/browse/trunk/lib/LatLongUTMconversion.py?r=246

There are also c# versions of some of it: at mediakey.dk/~cc/convert-northing-and-easting-utm-to-longitude-and-latitude/

Good luck.

Nick