Skip to main content

intersects

Returns true if geometries a and b have at least one point in common.

Intersects implies that disjoint is false.
Intersects is implied by contains, containsProperly, within, covers, coveredBy, crosses, overlaps and touches.

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 the intersection of geometry a and b is not an empty set

Throws

  • GEOSError on unsupported geometry types (curved)

See also

  • disjoint returns whether geometries not intersect; intersects(a, b) === !disjoint(a, b)
  • prepare improves performance of repeated calls against a single geometry

Examples