Search code examples
iphonegeolocationmapkitcllocationmanagerutm

iOS: How to convert MKMapPoint or CLLocationCoordinate2D to UTM?


From what I have read this takes some complicated Math that I am not good at. So, I am asking here.

Does anyone have experience converting a MKMapPoint or CLLocationCoordinate2D to a UTM value? I found this resource (http://www.uwgb.edu/dutchs/usefuldata/UTMFormulas.HTM) but the math is overwhelming.


Solution

  • You could use one lib to do that, or analyze the code of one lib to understand the algorithm and do it yourself.

    This is a c++ lib that does the job: http://geographiclib.sourceforge.net/html/

    http://geographiclib.sourceforge.net/html/classGeographicLib_1_1UTMUPS.html

    I found this website (http://home.hiwaay.net/~taylorc/toolbox/geography/geoutm.html). If you look at the source code, the whole conversion is done using JavaScript, you can have a look at it and try to convert to Obj-c.