Skip to content

Type comment are causing confusion: Says lat/long, but actually expect long/lat #91

@mrleblanc101

Description

@mrleblanc101

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:

mgrs/mgrs.js

Line 74 in 65bd498

* Convert lat/lon to MGRS.

mgrs/mgrs.js

Line 109 in 65bd498

* Convert MGRS to lat/lon bounding box.

mgrs/mgrs.js

Line 235 in 65bd498

* 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions