georust / geo

Geospatial primitives and algorithms for Rust
https://crates.io/crates/geo
Other
1.48k stars 191 forks source link

Add all remaining predicates: covered by, covers, crosses, overlaps, and touches #1136

Closed urschrei closed 5 months ago

urschrei commented 5 months ago

I want to do a little more checking with regard to the logic we use to determine whether the input dimensions differ (which is a requirement of the Crosses predicate), and conversely checking whether they're the same (a requirement of the Overlaps predicate). I'm currently doing this by interrogating the IM for the following two relations: a-interior / b-exterior and a-exterior / b-interior. I assert that if they're not equal the input geometry dimensions differ, and vice versa, but I'm not yet 100 % certain that this is true for all valid input geometries.

Addressed in https://github.com/georust/geo/pull/1136/commits/af8a50cf1da7ba014b3778751e16c95b1995bfae for all non multi-geometries.

urschrei commented 5 months ago

We now additionally check that neither of the input geometry dimensions are empty for Crosses and Overlaps

urschrei commented 5 months ago

There is what looks to be a straight forward typo in is_overlaps, but other than that LGTM.

One take it or leave it (truly) style thing.

Thanks for seeing this through!

Many thanks for the reviews. Our long national nightmare is over.