# Finding adjacent grid squares in MGRS/USNG

Given an MGRS grid reference, for example 4QFJ123678 (100m precision), is there a good way to obtain the adjacent squares (north, south, east and west) from that origin square?

Is it better to compute the neighbors within the MGRS system, or convert to lat/long, find the coordinates 100m away in each direction, and convert back to MGRS?

I believe that you cannot rely on computing adjacent MGRS grid references by altering the numeric values. I'm pretty sure that method works for going North and South but West or East is a problem because not all grid squares are 100,000km wide 30U YC 051 804 has an easterly neighbour of 31U BT 804 948 for instance, instead of the computable 30U YC 052 804. It is possible that even the method of moving a search point by a set distance may fail to return the adjacent grid square if the set distance is greater than the width of an adjacent grid square. I have a requirement for a system that allocates a location with a grid square identifier and then is able to find all such locations within a radius. I was hoping to do an initial coarse grain search for locations by getting all the grid square identifiers intersecting the area. Am not sure now if mgrs is the system to use due to this problem.

• Yes, as you near the polar regions, per the map on en.wikipedia.org/wiki/Military_Grid_Reference_System , the tapering zones overlap more and more, and the choices between overlapping zones depends on the geography underneath. Look at what happens between 31X and 33X: 32X is unused. Oct 14, 2021 at 16:15

Given the definition of the MGRS from wikipedia we know that your example `4QFJ123678` can be split up as follows:

• `4Q` is the Grid Zone (columns in a range of 1-60 and rows in the range C-X omitting I and O). As rows increase go further east, as columns increase go further North.
• `FJ` is the Grid Square (columns in the range A-Z and rows range A-V, both omitting I and O). Values increase to the East and North.
• `123 678` is the precision down to the 100 metre square in columns and rows. Values increase to the East and North.

So in the simplest case to get up, down, left, and right you just need to subtract or add from the 100 metre precision rows and columns, thus you get:

• North `4Q FJ 123 679`
• South `4Q FJ 123 677`
• East `4Q FJ 124 678`
• West `4Q FJ 122 678`

If you wanted to you could write this into a script pretty easily, but you would have to handle the cases where you cross Grid Squares and Grid Zones.

Also if you use Python might be to look at the Python mgrs library that converts to/from MGRS from latitude/longitude.

• Thanks, I suspected that the solution might be that simple but wasn't sure about generalizing it for all cases. I've seen library code that converts the MGRS grid reference to lat/long, computes the new lat/long 100m away, and then converts back to MGRS, but that seemed a bit roundabout.
– Matt
Mar 11, 2015 at 23:00
• That method would make the edge cases easier (crossing latitude bands, grid squares, zone boundaries) because the lat/lon-to-MGRS function should already handle them. Mar 12, 2015 at 16:07