Select to view content in your preferred language

MGRS to lat long or UTM Conversion.

16219
16
10-05-2011 02:45 AM
RahulRahul
Emerging Contributor
Can anyone please guide me on converting MGRS to lat/long or UTM.

Any help is greatly appreciated.

Rahul
0 Kudos
16 Replies
PaulWalton1
Emerging Contributor
No I just didn't know if you would still get the message from the old thread.

I noticed you supplied the code for the grid conversions to another user, I am currently doing a project and was hoping if you could supply it to me.

My email is paulboywal@gmail.com

It would be much appreciated.
0 Kudos
JeffPace
MVP Alum
the code is posted as a zip file in the 4th post of this thread
0 Kudos
PaulWalton1
Emerging Contributor
Jeff I have noticed a problem with your code. It doesn't give the correct lat and lon for southern hemisphere cases. I have managed to correct this by add an if statement in the UTMtoLL function. The if clause takes the UTMNorthing away from 10,000,000 and multiplies the Latitude by -1 if the UTM Letter is C-M.
0 Kudos
AdamSmith2
Deactivated User

Could you explain or show the code you used to fix the USNGtoLL function below the southern hemisphere?  I have a function that requires using this, and return NaN below the southern hemisphere when using this function.

0 Kudos
TimWitt2
MVP Alum

Adam,

maybe the code I used here can help.

It doesn't include utm though.

Location, Location, Location... - JSFiddle

Tim

0 Kudos
AdamSmith2
Deactivated User

So you use esri's geocoding service to convert to from USNG/MGRS to LL?

0 Kudos
TimWitt2
MVP Alum

Yes, I found out that's the easiest.

0 Kudos