Skip to main content

coveredBy

Returns true if geometry a lies in geometry b.

Geometry a is covered by geometry b if all points of a are in the interior or at the boundary of b.

If either geometry is empty, returns false.

coveredBy is the converse of covers: coveredBy(a, b) === covers(b, a).

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 geometry a is covered by geometry b

Throws

  • GEOSError on unsupported geometry types (curved)

See also

  • covers converse of coveredBy
  • within less inclusive coveredBy
  • prepare improves performance of repeated calls against a single geometry

Examples

differences with 'within'