Closed DanielJDufour closed 5 years ago
@calvinmetcalf and @ahocevar , open to your thoughts :-)
so what is the tl;dr of the issue, that certain software calculates from the origin but others from the centroid ?
@calvinmetcalf, yes. That's correct.
You introduce code and complexity for only one (very) special / peculiar use case. Not advisable for a general purpose library ...
I don't know if it is possible, but as it is a special case, you could maybe name it as an independent library (S2-MGRS could it be?), so that the standard version would be not affected by any change/update. :)
Thanks for the comments everyone. I did some more research into how the latitude band letter is determined in the Sentinel 2 titling grid. It appears that the band letter is based on the first point in the polygon representing the MGRS 100km grid cell and not the centroid or center point of the cell. They just both happen to lead to the same conclusion quite often. My recommendation for people trying to determine a Sentinel 2 Tile based on a latitude/longitude is to create a separate library. Thank you for your patience while I investigated this matter. I'll submit a separate PR for adding the ability to get the 100km MGRS Grid Cell by passing in an accuracy of 0.
You can find my (messy) work doing the research here: https://github.com/DanielJDufour/s2a-tiling-grid-analysis
Changes:
Open to comments, suggestions and input :-)