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

Bugfix/58/h3 parent approach #69

Merged
merged 11 commits into from
Sep 30, 2024
Merged

Bugfix/58/h3 parent approach #69

merged 11 commits into from
Sep 30, 2024

Conversation

zacdezgeo
Copy link
Collaborator

What I Changed

  • Implemented the _find_touches function to identify H3 hexagon IDs that intersect with the boundary of the polygon defined by the AOI GeoJSON and include neighboring hexagons.
  • Refactored the _recursive_polyfill method to handle cases where no H3 IDs are returned, allowing it to continue to higher resolutions until a valid result is found.
  • Enhanced the logic to ensure the correct filtering of H3 hexagon IDs based on spatial join methods: within and touches.

How to Test It

  • See test_h3_utils.py
  • Use the generate_h3_ids function with various Polygon GeoJSON inputs to ensure that H3 IDs are generated correctly for different geographic shapes.
  • Verify that the filtering based on spatial join methods works as expected, particularly with the new _find_touches function.
  • Run the existing unit tests to confirm that no regressions have occurred in the functionality.

Quick example running with the touches keyword:
image

Other Notes

@zacdezgeo zacdezgeo added bug Something isn't working enhancement New feature or request labels Sep 26, 2024
@zacdezgeo zacdezgeo self-assigned this Sep 26, 2024
@zacdezgeo zacdezgeo marked this pull request as draft September 26, 2024 04:11
@zacdezgeo zacdezgeo marked this pull request as ready for review September 26, 2024 14:30
Andres notebook raised the initial bug for the small geometries. The notebook reproduced the issue and now demonstrates the fix.
@zacdezgeo zacdezgeo merged commit e2dfb0f into main Sep 30, 2024
2 checks passed
@zacdezgeo zacdezgeo deleted the bugfix/58/h3-parent-approach branch September 30, 2024 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Raise exception when no data is returned for small features
3 participants