I've been trying to figure out why 46.83087249468004, -71.29936529210055 would result in 38DNF6550888223 (the middle of nowhere).
But using earthpoint.us, it would result in 19TCM2464188936.
I'm not a geodesy expert, so when I saw some of the comments mention lat/long instead of long/lat, it caused me to pass the arguments as lat/long, but the function expect long/lat.
From the npm/github description
Utility for converting between WGS84 lat/lng and MGRS coordinates
And 3 places in the code:
|
* Convert lat/lon to MGRS. |
|
* Convert MGRS to lat/lon bounding box. |
|
* Converts UTM coords to lat/long, using the WGS84 ellipsoid. This is a convenience |
And 3 places in the types:
|
* Convert lat/lon to MGRS. |
|
* Convert MGRS to lat/lon bounding box. |
|
* Convert MGRS to lat/lon point. |
I guess the params are typed correctly:
@param ll
Array with longitude and latitude on a WGS84 ellipsoid.
But there is no runtime check, so it took some time to figure out.
I've been trying to figure out why
46.83087249468004, -71.29936529210055would result in38DNF6550888223(the middle of nowhere).But using earthpoint.us, it would result in
19TCM2464188936.I'm not a
geodesyexpert, so when I saw some of the comments mentionlat/longinstead oflong/lat, it caused me to pass the arguments aslat/long, but the function expectlong/lat.From the npm/github description
And 3 places in the code:
mgrs/mgrs.js
Line 74 in 65bd498
mgrs/mgrs.js
Line 109 in 65bd498
mgrs/mgrs.js
Line 235 in 65bd498
And 3 places in the types:
mgrs/index.d.ts
Line 3 in 65bd498
mgrs/index.d.ts
Line 14 in 65bd498
mgrs/index.d.ts
Line 25 in 65bd498
I guess the params are typed correctly:
But there is no runtime check, so it took some time to figure out.