Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mgrs conversions #44

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mkellogg91
Copy link

in my use of usng.js while I could convert Lat Lon to MGRS I could not find a way to convert MGRS to Lat Lon.

I wrote a function to convert MGRS to USNG and then used USNG's existing USNGtoLL function for converting from MGRS to Lat Lon in the MGRStoLL function.

an example is:
converter.MGRStoLL("4QFJ2128465763")

@mkellogg91
Copy link
Author

hey @vinamartin, didn't see any guidelines on how to submit a PR, and I'm not sure if anyone has seen this request

@vinamartin
Copy link
Member

@mkellogg91 Hi there! I'll tag a few folks to look at this, I'm not super active on this project at this time but maybe @jaymcnallie, @jlcsmith, or @pklinef could give this a review?

@pklinef
Copy link
Member

pklinef commented Aug 16, 2021

@mkellogg91 I think these changes would only work if the datum being used was WGS84 for USNG. But currently I think we only support NAD27 and NAD83 for USNG.

https://github.com/codice/usng.js/blob/master/src/usng.ts#L187-L200

https://www.maptools.com/tutorials/mgrs_usng_diffs
http://semonitoringguide.sepif.org/sampling-grids/military-grid-reference-system

@mkellogg91
Copy link
Author

mkellogg91 commented Aug 27, 2021

@pklinef I'm using currently using USNG with the WGS84 datum in my use case and it's working fine. I get what you are saying though if another datum was being used for my conversion functions. Not sure if this change could still be adopted if it was somehow earmarked for only WGS84. All my users care about is WGS84

@pklinef
Copy link
Member

pklinef commented Aug 30, 2021

@mkellogg91 An alternative would be to add the ability to set the USNG options to a WGS84 datum in addition to the currently supported NAD27 and NAD83 standard datums. Then we could allow that conversion as you have it now only if the WGS84 datum is configured. That would help protect someone using one of the two standard USNG datums from accidentally converting and getting an incorrect conversion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants