Académique Documents
Professionnel Documents
Culture Documents
1 Manual
176 / 315
7.8.8 ST_CoveredBy
Name
ST_CoveredBy Returns 1 (TRUE) if no point in Geometry/Geography A is outside Geometry/Geography B
Synopsis
boolean ST_CoveredBy(geometry geomA, geometry geomB);
boolean ST_CoveredBy(geography geogA, geography geogB);
Description
Returns 1 (TRUE) if no point in Geometry/Geography A is outside Geometry/Geography B
Performed by the GEOS module
Important
Do not call with a GEOMETRYCOLLECTION as an argument
Important
Do not use this function with invalid geometries. You will get unexpected results.
Examples
--a circle coveredby a circle
SELECT ST_CoveredBy(smallc,smallc) As smallinsmall,
ST_CoveredBy(smallc, bigc) As smallcoveredbybig,
ST_CoveredBy(ST_ExteriorRing(bigc), bigc) As exteriorcoveredbybig,
ST_Within(ST_ExteriorRing(bigc),bigc) As exeriorwithinbig
FROM (SELECT ST_Buffer(ST_GeomFromText(POINT(1 2)), 10) As smallc,
ST_Buffer(ST_GeomFromText(POINT(1 2)), 20) As bigc) As foo;
--Result
smallinsmall | smallcoveredbybig | exteriorcoveredbybig | exeriorwithinbig
--------------+-------------------+----------------------+-----------------t
| t
| t
| f
(1 row)
See Also
ST_Contains, ST_Covers, ST_ExteriorRing, ST_Within
7.8.9 ST_Crosses
Name
ST_Crosses Returns TRUE if the supplied geometries have some, but not all, interior points in common.
Synopsis
boolean ST_Crosses(geometry g1, geometry g2);
Description
ST_Crosses takes two geometry objects and returns TRUE if their intersection "spatially cross", that is, the geometries have
some, but not all interior points in common. The intersection of the interiors of the geometries must not be the empty set and
must have a dimensionality less than the the maximum dimension of the two input geometries. Additionally, the intersection of
the two geometries must not equal either of the source geometries. Otherwise, it returns FALSE.
In mathematical terms, this is expressed as:
Important
Do not call with a GEOMETRYCOLLECTION as an argument
Note
This function call will automatically include a bounding box comparison that will make use of any indexes that are
available on the geometries.
This method implements the OpenGIS Simple Features Implementation Specification for SQL 1.1. s2.1.13.3
This method implements the SQL/MM specification. SQL-MM 3: 5.1.29