mgrs-java icon indicating copy to clipboard operation
mgrs-java copied to clipboard

MGRS and the South Pole

Open dtvasquez opened this issue 1 year ago • 3 comments

Please fill out as much known and relevant information as possible.

Version Information:

  • MGRS Java Version: 212
  • MGRS Java Source: (e.g. Central Repository, Release, Source Code Build) maven
  • IDE Name & Version: Android Studio
  • Maven Version: (mvn -version)
  • Java Version: (java -version) 11
  • Platform & OS: Android 7+
  • Other Relevant Libraries:

Expected Results:

  • What did you expect to happen?

Create an MGRS object near the Poles. Example: AQE 33377 29769
Using the GEOTrans utility/source code, this value can be parsed as valid MGRS

Observed Results:

  • What happened instead?
    MGRS.parse() throws a ParseException
  • How often does this occur?
    Anytime a valid location near the poles is used, it fails the regex in use ^(\\d{1,2})([C-HJ-NP-X])(?:([A-HJ-NP-Z][A-HJ-NP-V])((\\d{2}){0,5}))?$

Output:

  • Any logs, errors, or output messages?
    ParseException("Invaliid MGRS")

Steps to Reproduce:

  1. Try to parse an MGRS string that represents a location at the poles
  2. ParseException

Relevant Code:

MGRS mgrs = MGRS.parse("AQE3337729769");

Test Files:

  • Links to any files needed for testing?

Additional Information:

  • Any additional configuration, data, or information that might help with the issue?

MGRS uses UPS project to cover the poles, where A|B cover the South Pole, and Y|Z cover the North Pole. I didn't see references to ups in the source for this project. Are there plans to add support for the poles?

image image

dtvasquez avatar Apr 12 '23 18:04 dtvasquez