geodesy icon indicating copy to clipboard operation
geodesy copied to clipboard

MGRS parsing issue

Open avenmia opened this issue 3 years ago • 0 comments

Wikipedia gives the following examples for MGRS values:

https://en.wikipedia.org/wiki/Military_Grid_Reference_System

4Q .....................GZD only, precision level 6° × 8° (in most cases) 4QFJ ...................GZD and 100 km Grid Square ID, precision level 100 km 4QFJ 1 6 ...............precision level 10 km 4QFJ 12 67 .............precision level 1 km 4QFJ 123 678 ...........precision level 100 m 4QFJ 1234 6789 .........precision level 10 m 4QFJ 12345 67890 .......precision level 1 m

But parsing fails because the parse function in mgrs.js checks if the first two values are of type number. https://github.com/chrisveness/geodesy/blob/8f4ef33d3a2e6b7127b5fa619a0b98042dbd0745/mgrs.js#L149-L158

avenmia avatar May 24 '22 18:05 avenmia