Skip to content

Fix collection interior handling - #32

Merged
tidwall merged 8 commits into
tidwall:mainfrom
paleolimbot:collection-containment
Sep 18, 2026
Merged

tidwall merged 8 commits into
tidwall:mainfrom
paleolimbot:collection-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 PR fixes geometrycollection interior handling, whereby the highest dimension member of the collection's interior is the only one that counts. This affects the touches and containment predicates.

The original approach in apache/sedona-db#1042 counted point, line, and poly interior hits...this approach tracks min/max dimensions and seems to be a bit more succinct. The fix in that PR also doesn't handle touches. I tried to constrain it to just geometry collection paths.

Happy to change the approach here.

Issue number and link

Closes #20.

@tidwall

tidwall commented Sep 18, 2026

Copy link
Copy Markdown
Owner

I read through the code. Overall I don't mind this approach. I'm going to merge.
I may do a little cleanup on main.

@tidwall
tidwall merged commit 7b0f2cb into tidwall:main Sep 18, 2026
2 checks passed
@tidwall

tidwall commented Sep 18, 2026

Copy link
Copy Markdown
Owner

Thanks again. I really appreciate it.

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.

Contains and Within predicates may produce incorrect results when geometry collection is involved.

2 participants