Skip to content

PreparedGeometry: add Crosses method #700

Description

@peterstace

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

  1. Set the global isRelateNG flag and investigate/fix the EqualsTopo discrepancy for degenerate geometries.
  2. Have the geom package call RelateNG directly for Crosses (bypassing the global flag), though this means modifying the JTS transliteration layer.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    jtsportJava Topological Suite Port

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions