Skip to main content

crosses

Returns true if geometries a and b spatially cross.

Geometry a crosses geometry b if both geometries have some, but not all interior points in common, and the dimension of their intersection must be lower than the maximum dimension of either a or b.

Operation is valid for the following situations:

  • Point/Line and Line/Point (Point intersection),
  • Point/Area and Area/Point (Point intersection),
  • Line/Area and Area/Line (Line intersection),
  • Line/Line (Point intersection).

Always returns false for Point/Point and Area/Area situations.

warning

Do not use this function with invalid geometries. You will get unexpected results.

Parameters

NameTypeDescription
aGeometry | Prepared<Geometry>First geometry
bGeometrySecond geometry

Returns

boolean

true if geometries a and b spatially cross

Throws

  • GEOSError on unsupported geometry types (curved)

See also

  • prepare improves performance of repeated calls against a single geometry

Examples

crosses: true
crosses: false