ST_Covers — Tests if a Geometry A spatially covers another Geometry B.
boolean ST_Covers(
bytea GeomA, bytea GeomB)
;
Tests if a Geometry A spatially covers another Geometry B, returns TRUE if so. The covers predicate has the following equivalent definitions:
Geometry A covers Geometry B iff no points of B lie in the exterior of A.
Every point of B is a point of A.
The DE-9IM Intersection Matrix for the two geometries is T*****FF* or *T****FF* or ***T**FF* or ****T*FF*
The reverse function of ST_Covers is ST_CoveredBy |
This method does not support GeometryCollection arguments |
2D | 3D | M |
---|---|---|
OGC SFS for SQL. 1.1 (1999) | OGC SFS for SQL. 1.1.0 (2005) | OGC SFS for SQL. 1.2.0 (2006) | SQL-MM Part 3 |
---|---|---|---|
- | - | - | - |
SELECT ST_Contains(PolyA,LineB), ST_ContainsProperly(PolyA,LineB),ST_Covers(PolyA,LineB) from (SELECT ST_GeomFromText('POLYGON ((10 30, 6 15, 30 20, 30 30, 20 40, 10 30))') as PolyA, ST_GeomFromText('LINESTRING (10 30, 15 35)') as LineB) as foo; st_contains | st_containsproperly | st_covers -------------+---------------------+----------- f | f | t
ST_Contains(PolyA,LineB) = FALSE | ST_ContainsProperly = FALSE | ST_Covers = TRUE |