-
|
I need to convert MGRS coordinates into WGS84 latitude/longitude using PHPCoord. For example, I would like to transform the MGRS string: Is there a built‑in way in PHPCoord to handle MGRS → WGS84 conversion, or do I need to parse MGRS manually into UTM and then convert? If there is an existing class or method, could you please point me to the correct usage? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
You're correct, there's no built-in support for MGRS references so you'll need do the first part yourself the hard way and convert to a Not sure of the spec on how the grid references letters are calculated, you might be able to take inspiration from But MGRS->UTM is definitely the way to go. If you get it working, I'd be happy to consider a PR to add it to the library |
Beta Was this translation helpful? Give feedback.
You're correct, there's no built-in support for MGRS references so you'll need do the first part yourself the hard way and convert to a
UTMPoint, from there everything should be automagic back into geographic coordinates.Not sure of the spec on how the grid references letters are calculated, you might be able to take inspiration from
BritishNationalGridPointto calculate them but that does assume a square grid and some of the charts I just saw looked more degree-based.But MGRS->UTM is definitely the way to go. If you get it working, I'd be happy to consider a PR to add it to the library