[GIS] Detecting MGRS/UTM zone

coordinate systemmgrsutm

I posted a similar question as an answer on Stack Overflow, and it was recommended that I ask here instead.

I am developing an open-source library for converting between coordinate systems, and I've run into a wall.

I want to be able to perform a transformation on an MGRS point. I want to be as accurate as possible, so I'd rather not convert to lat/long first, but that's the only way that I've been able to think about doing it.

Here are the circumstances:

  • I have a starting MGRS position
  • I see something in the distance and measure it's distance
  • I want to know the MGRS coordinate of said point

Is there any way of detecting whether I've crossed a zone boundary without converting to lat/long first?

It seems to me that MGRS zones (or UTM zones for that matter) are based on latitude/longitude.

Best Answer

Doing this the "obvious" way will be accurate (and fast) enough: Convert the center of the MGRS square to UTM (exact). Convert UTM to Lat/Long (error = 5 nanometers). Compute the new position as a geodesic calculation (error = 15 nanometers). Convert to UTM (error = 5 nanometers). Convert to MGRS (exact). So the total error is 25 nanometers or less. (The errors quoted are those obtained with GeographicLib, a library of accurate geographic routines written by me.)