I am writing a coordinate conversion library for javascript (for both NodeJS and browser javascript). I have quite a bit done already. Check it out if you’re interested. I didn’t write most of the code, so I’m not exactly sure how everything works.
From what I can tell, MGRS/USNG zones are basically renamed UTM zones, which in turn are defined in terms of lat/long.
Let’s say I have an MGRS coordinate and I move a certain displacement. Can I accurately determine whether I crossed a zone boundary without first converting to lat/long? I know how to update coordinates as I move within a zone because most everything is square within zones.
Is there a way to detect zone changes without having to convert to lat/long?
Are there any libraries, in any language, that do this?
The existing code requires a latitude and longitude, so I guess I could convert to lat/long, apply the transformation, and then convert back to MGRS. This wouldn’t be that bad if I only want to determine the zone I’m in, then I can keep the rest of the transformation stuff in MGRS to maintain precision. The only issue is, I want to be as precise as possible.
Note:
I did find this article explaining coordinate conversions, but this doesn’t really cover coordinate transformations.
From what I’ve found, it is not possible to convert directly between MGRS and Lat/Long.
MGRS (or USNG for that matter) uses the same zone definitions as UTM, which is defined by lat/long coordinates. UTM and MGRS (USNG) make the world essentially flat, using fudge factors to maintain close accuracy (within a meter or so). Since these grids are treated as being flat, they are not reliable for determining zone boundaries, which are defined in terms of the great circle.
Conversion between MGRS and UTM is easy (and pretty much lossless), and conversion between UTM and lat/long is pretty accurate, albeit not 100% precise.
From what I’ve read, the best way to accurately translate an MGRS coordinate is to first convert it to lat/long, apply the tranlation, then convert back. This is good for detecting zone changes, but a more accurate destination point could potentially be found by using the zone from the lat/long conversion and applying the rest of the translation in MGRS coordinates. This should detect mid-square zone changes.
References/Resources:
http://en.wikipedia.org/wiki/Military_grid_reference_system
http://www.stellman-greene.com/mgrs_to_utm/