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

fix: generic dem tile names for SW hemisphere #63

Merged
merged 1 commit into from
Dec 22, 2024

Conversation

edparris
Copy link
Contributor

This change fixes an error in how the DEM file names are calculated by the GenericDEMTileSet. The original code did not handle coordinates in the South or West hemispheres correctly (negative decimal degrees values). The DEM tile 044W contains elevation values for coordinates [-44.0, -43.0) so a coordinate value of -43.5 needs to be floored to -44. That is the natural behavior of the python floor() operator but the original implementation was relying on the degrees, minutes, seconds calculation in the GeodeticWorldCoordinate format operator which converts the decimal value to a positive number before truncating the degrees. This change floors the number before passing it into the format string ensuring the correct decimal value is chosen for a DEM tile. Unit tests have been updated to include the failing example that brought this issue to our attention.

Checklist

Before you submit a pull request, please make sure you have the following:

  • Code changes are compact and well-structured to facilitate easy review
  • Changes are documented in the README.md and other relevant documentation pages
  • PR title and description accurately reflect the changes and are detailed enough for historical tracking
  • PR contains tests that cover all new code and the code has been manual tested
  • All new dependencies are declared (if any), and no unnecessary libraries are added
  • Performance impacts (if any) of the changes are evaluated and documented
  • Security implications of the changes (if any) are reviewed and addressed
  • I have read the Contributing Guidelines and agree to follow the Code of Conduct

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@edparris edparris force-pushed the hotfix/generic-dem-tileset-sw-hemisphere branch from c89faf8 to 4338fe3 Compare December 21, 2024 01:42
@edparris edparris merged commit 8ae9226 into main Dec 22, 2024
1 check passed
@edparris edparris deleted the hotfix/generic-dem-tileset-sw-hemisphere branch December 22, 2024 15:52
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.

2 participants