# How to detect MGRS/UTM zone?

I posted a similar question on StackOverflow, but I thought I'd check here as well.

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.

-
Speaking for UTM, each coordinate pair has 120 possible positions on earth (60 north of the equator and 60 south), so you need to know the zone number as a bare minimum, then it is simple to figure where you are. You can't rely on the coordinates themselves, since as you head poleward, the distance between the east and west meridians decreases yet the false easting remains the same. – Dan Patterson May 18 '11 at 23:32
@Mapperz - Is there anything that will allow me to give a starting coordinate and displacement and produce a relatively accurate ending coordinate (within 50 meters or so, preferably within 10)? – tjameson May 19 '11 at 16:12

## 2 Answers

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.)

-

You need a bearing (angle to the north direction) to your target as well.

Then you can make a simple trigonometric 2D-calculation of the planar coordinates. MGRS and UTM "work" also just accross the border of the zone. You can make transformation to lat/lon and into the next zone, but that makes distance calculations rather difficult.

This will not work for continent-wide projects. I would suggest some lambert projectiosn (laea or lcc) for that.

-