Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to view the Military Grid Reference System coordinates in Openlayers through the MousePosition control. Is there an easy way to accomplish this just through Javascript? I am looking at the Proj4 library and I can't seem to find support for this.

Also, why can I not find an EPSG code for this reference system? Being relatively new to geospatial web development, the answers I am finding online are just sending me in circles.

Any help would be awesome. Thanks!

share|improve this question
up vote 7 down vote accepted

you can use U.S. National Grid functions. add this code to your index page

<script src=”usng.js” mce_src=”usng.js”></script>

and then run this method:

1.LLtoUSNG(lat, lon, precision) : convert lat/lng decimal degrees to a USNG string


alert(LLtoUSNG(lat, long, 5));

example result:

Five digits:  1 meter precision    eg. "18S UJ 23480 06470"

2.USNGtoLL(usng_string,latlng) : convert a USNG string to lat/lng decimal degrees

example input:


3.LLtoUTM(lat,lon, utmcoords): Converts lat/long to UTM coords.

there are some informations in js...

As for the other question, mgrs system is not a coordinate tuple because of having four parameters. in normal case coordinate tuples consist of two parameter as lat and lon...

i hope it helps you...

share|improve this answer
wow thanks! Go that working instantly! – Kyle May 17 '12 at 17:08
Bastion of knowledge wikipedia says "It resembles the Military Grid Reference System (MGRS). When the WGS84 datum or NAD83 datum is used, USNG and MGRS coordinates are practically identical." The question, I think, is how are they not precisely identical? Possibly also worth pointing out that the lib linked in this answer is GPL'd. – ruffin Sep 13 '12 at 19:17
Looks like you can get that answer here. For NAD 83 or WGS 94, they produce "equivalent" values. In NAD 27, there's a difference, apparently. – ruffin Sep 14 '12 at 12:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.