Skip to content

DE-9IM filters#13

Open
patrickbr wants to merge 9 commits intomasterfrom
de9im-filter
Open

DE-9IM filters#13
patrickbr wants to merge 9 commits intomasterfrom
de9im-filter

Conversation

@patrickbr
Copy link
Copy Markdown
Member

@patrickbr patrickbr commented Dec 2, 2025

The goal of this PR is to add DE-9IM filters to spatialjoin. If a DE-9IM filter is given, then we will only compute relations between geometry pairs which match this filter. Note than "give me all pairs which match a given DE-9IM filter" is a subproblem of this, but not if the DE-9IM filter catches disjoint geometries. The problem of "give me all pairs of objects which are (or may be) disjoint" is ignored in this PR (and the result would be unrealistic to materialize for most real-world datasets anyhow, for OSM with 64 bit IDs, it would be in the order of 1 Zettabyte).

…s of objects which match a given DE9IM filters", of which "give me pairs of objects that intersect and match a given DE9IM filter" is a subproblem
@patrickbr
Copy link
Copy Markdown
Member Author

patrickbr commented Dec 2, 2025

As a first step, replace the old ::check( routines which used the legacy util::geo::intersectsContainsCovers( method and basically return a simplified DE-9IM matrix with their ::checkDE9IM( equivalent to remove a ton of duplicate code.

Doing this for area/area pairs already dug up a very rare edge case in which the DE-9IM matrix depended on the order of the two input areas. One order always produced the wrong result. This may have happened if the option to precompute surface areas was explicitly disabled, the bounding boxes of both areas were exactly equivalent, and both polygons were nearly equivalent. In this scenario, we now compute the missing surface area on-the-fly to break a comparison tie.

@patrickbr
Copy link
Copy Markdown
Member Author

Legacy code now completely removed, in total this unearthed 2 edge case bugs with the DE9IM computation, which are now fixed + covered by tests.

… useful shortcuts (dont add geoms to sweep event list which cannot match the given --de9im-filter because of their interior/boundary dimensions
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.

1 participant