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

Half-sized grid near meridian return wrong coordinates #25

Open
solsticedhiver opened this issue Jul 14, 2017 · 2 comments
Open

Half-sized grid near meridian return wrong coordinates #25

solsticedhiver opened this issue Jul 14, 2017 · 2 comments
Labels

Comments

@solsticedhiver
Copy link

solsticedhiver commented Jul 14, 2017

Just look at that example: 31TBN73
This 10x10km MGRS zone is near the prime meridian. It is not a complete full size zone and its size is divided roughly by 2.

When you run:

> mgrs.inverse('31TBN73')
[-0.035799295305842804, 47.18325044910646, 0.0910966355893934, 47.276538500931856]

The returned coordinate are the one for a full sized zone. whereas the first longitude should be 0°.

One can find this error for all zones that are near a meridian of an UTM zone where the MGRS zone are half-sized.

On this fiddle https://jsfiddle.net/a8830fcv/4/, one can see in black the correct 31TBN73 and in red the portion of the zone that is wrong, crossing over the prime meridian.

The same is true for example for 30TYT21 and so on...

@DanielJDufour
Copy link
Collaborator

Great catch @solsticedhiver . A new maintainer here. I'll look into this! Thanks!

@DanielJDufour
Copy link
Collaborator

I looked into this more and I can confirm your issue.

I downloaded the relevant and authoritative MGRS 1km grid zone file from http://earth-info.nga.mil/GandG/update/index.php?dir=coordsys&action=mgrs-1km-polyline-dloads . I loaded the file into QGIS and it does appear that the zones cut off at the prime meridian.
image

I should also note that earthpoint.us appears to have it wrong as well.
image

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

No branches or pull requests

2 participants