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
| Name | Type | Description |
|---|---|---|
a | Geometry | Prepared<Geometry> | First geometry |
b | Geometry | Second geometry |
Returns
boolean
true if geometry a covers geometry b
Throws
GEOSErroron unsupported geometry types (curved)
See also
coveredByconverse ofcoverscontainsless inclusivecoverscontainsProperlyless inclusivecontainsprepareimproves performance of repeated calls against a single geometry
Examples
differences with 'contains'