Skip to main content

covers

Returns true if geometry b lies in geometry a.

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

If either geometry is empty, returns false.

covers is the converse of coveredBy: covers(a, b) === coveredBy(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 covers geometry b

Throws

  • GEOSError on unsupported geometry types (curved)

See also

Examples

differences with 'contains'