PreparedGeometry: add Crosses method
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start by reading the PreparedGeometry implementation added in #699 and trace its Crosses path through RelateMatrix and RelateNG. Compare the two possible approaches in the issue, including the existing xmltest failure for EqualsTopo on degenerate geometries. Done means prepared Crosses handles geometry collections without changing the established EqualsTopo behavior.
Written by the indexing model from the issue text.
Description
Summary
PreparedGeometry is missing the Crosses predicate. All other spatial predicates are supported (Intersects, Contains, ContainsProperly, CoveredBy, Covers, Disjoint, Overlaps, Touches, Within).
PreparedGeometry was added in #699.
Background
The underlying JTS prepared geometry implementation delegates Crosses to baseGeom.Crosses(), which calls RelateMatrix() → geom_GeometryRelate_Relate(). When the global isRelateNG flag is false (the default), this code path calls CheckNotGeometryCollection and panics for geometry collection inputs.
The non-prepared geom.Crosses works fine because it goes through Relate() → jtsRelateNG(), which always uses RelateNG and handles geometry collections.
Switching the global isRelateNG flag to true fixes Crosses but introduces a behavioral difference in EqualsTopo for degenerate geometries (e.g. POINT(110 200) vs LINESTRING(110 200, 110 200)), causing an existing xmltest to fail.
Possible approaches
- Set the global
isRelateNGflag and investigate/fix theEqualsTopodiscrepancy for degenerate geometries. - Have the
geompackage call RelateNG directly forCrosses(bypassing the global flag), though this means modifying the JTS transliteration layer.
- Dominant language
- Go
- Stars
- 176
- Forks
- 27
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 4
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from peterstace/simplefeatures
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
peterstace/simplefeatures#726 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
peterstace/simplefeatures#725 ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 58/100
peterstace/simplefeatures#724 ·
-
cleanup
Difficulty 3/5 1-2 days Newbie friendliness 35/100
peterstace/simplefeatures#722 ·
-
bug
Difficulty 3/5 Half a day Newbie friendliness 45/100
peterstace/simplefeatures#721 ·
All issues in peterstace/simplefeatures
Similar issues
-
area: import bug go good first issue priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
fukubie/StockLlama#69 ·
-
enhancement help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
cloverworks-hq/rumpty-cli#95 ·
Maintainers usually reply within 1 day
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 88/100
pulseaiclub/phi#615 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day