I'm wondering what kind of libraries exist (licensed or not) where I may find the methods to convert between latitude/longitude coordinates and military grid reference system (mgrs) coordinates. I'm not explicitly looking for a lat/long to UTM converter, it has to be mgrs. I've done some searching and googling and from what I've found, lat/long to UTM frequently shows up, but it seems like nobody has got the library for converting lat/long to MGRS and vice versa.
Does anyone know of any libraries or places where I can find libraries that will do such a thing?
Thanks, any help is appreciated.
tf.rz
So to convert a (WGS84) latitude/longitude point to an OS grid reference, it must first be converted from the WGS84 datum to the OSGB36 datum, then have the transverse Mercator projection applied to transform it from a curved surface to a flat one.
Look at the top of your map at the easting numbers, and move right until you find the 30 grid line. Look at the side of your map at the northing number and move up until you find the 95 grid line. Follow the lines to where they intersect. That is the bottom left corner of the grid square that we'll be working with.
Then go to Tools>Options>3D View>Show lat/long. Select MGRS.
I know this is an old post, but I'll add some more for posterity. JCoords has an MGRS point conversion, but it requires a small licensing fee. Another source is NASA's WorldWind project (similar to Google Earth), which converted the old GeoTrans API created by NGA. This is the implementation of the MGRS conversion: MGRSCoordConverter.java
I've found a library called OpenMap in the library com.bbn.openmap.proj.coords they have a class called mgrs point. Props to a few questions on stackoverflow for providing various answers. I've been unable to find the question in this answer, but it got me the answer I was looking for: openmap! However, the latitude longitude conversion to mgrs points seems to be faulty, but the reverse works perfectly fine; and that's what I needed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With