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
isRelateNG flag and investigate/fix the EqualsTopo discrepancy for degenerate geometries.
- Have the
geom package call RelateNG directly for Crosses (bypassing the global flag), though this means modifying the JTS transliteration layer.
Summary
PreparedGeometryis missing theCrossespredicate. All other spatial predicates are supported (Intersects, Contains, ContainsProperly, CoveredBy, Covers, Disjoint, Overlaps, Touches, Within).PreparedGeometrywas added in #699.Background
The underlying JTS prepared geometry implementation delegates
CrossestobaseGeom.Crosses(), which callsRelateMatrix()→geom_GeometryRelate_Relate(). When the globalisRelateNGflag isfalse(the default), this code path callsCheckNotGeometryCollectionand panics for geometry collection inputs.The non-prepared
geom.Crossesworks fine because it goes throughRelate()→jtsRelateNG(), which always uses RelateNG and handles geometry collections.Switching the global
isRelateNGflag totruefixesCrossesbut introduces a behavioral difference inEqualsTopofor degenerate geometries (e.g.POINT(110 200)vsLINESTRING(110 200, 110 200)), causing an existing xmltest to fail.Possible approaches
isRelateNGflag and investigate/fix theEqualsTopodiscrepancy for degenerate geometries.geompackage call RelateNG directly forCrosses(bypassing the global flag), though this means modifying the JTS transliteration layer.