Skip to content

Fix polygon / collection containment involving boundary points and nested empties - #35

Merged
tidwall merged 15 commits into
tidwall:mainfrom
paleolimbot:polygon-multipoint-containment
Oct 5, 2026
Merged

tidwall merged 15 commits into
tidwall:mainfrom
paleolimbot:polygon-multipoint-containment

Conversation

@paleolimbot

Copy link
Copy Markdown
Contributor

Please do not open a pull request without first filing an issue and/or discussing the feature directly with me.

Please ensure you adhere to every item in this list

  • This PR was pre-approved by the project maintainer
  • I have self-reviewed the code
  • I have added all necessary tests

Describe your changes

This changes polygon containment of collections to use a recursive walk of the non-collection leaves to check emptiness, return early for geometries that aren't covered, but keep iterating until at least one non-boundary containment is found.

Technically this implementation repeats some work for nested collections (Codex suggested a recursive warlk of leaf geometries, which I'm happy to do as well).

Issue number and link

This one surfaced from a SedonaDB test:

apache/sedona-db#1165 (comment)

@tidwall
tidwall merged commit 8d294a6 into tidwall:main Oct 5, 2026
2 checks passed
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