I'm looking for a function/formula/library that basically takes a MGRS square identifier such as 4QFJ16 and returns me the coordinates of the 4 corners of this polygon in some simple form such as EPSG:4326 lat/lon pair.

The idea behind is that I regularly have data to display where we only know in which square it was taken (no northing/easting information). So I'd simply like to be able to display this specific polygon on a map.

What I can find easily is large graticules as shapefiles, or information to convert a specific point in this square to lat/lon coordinates.

But some "as simple as possible" formula would be better, since I could easily make browser calculations instead of embedding a huge amount of data (the complete graticule). Also, a formula would have the advantage to be language-agnostic, so I can use it for different use cases (realtime JS conversion JS, filling a PostGIS database, ...).

I don't need a huge precision, I work with 10 or 1km MGRS squares.

Hope my question is clear. Many thanks in advance.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.