- Categories:
ST_COVERS¶
Returns TRUE if no point in one geospatial object is outside of another geospatial object. In other words:
GEOGRAPHY object
g2is outside GEOGRAPHY objectg1.GEOMETRY object
g2is outside GEOMETRY objectg1.
ST_COVERS is similar to, but subtly different from, ST_CONTAINS. For details on the differences between “covers” and “contains”, see the Dimensionally Extended 9-Intersection Model (DE-9IM).
Although ST_COVERS and ST_CONTAINS might seem similar, the two functions have subtle differences. For details on the differences between “covers” and “contains”, see the Dimensionally Extended 9-Intersection Model (DE-9IM).
Note
This function does not support using a GeometryCollection or FeatureCollection as input values.
Tip
You can use the search optimization service to improve the performance of queries that call this function. For details, see Search optimization service.
- See also:
Syntax¶
Arguments¶
geography_expression_1A GEOGRAPHY object that is not a GeometryCollection or FeatureCollection.
geography_expression_2A GEOGRAPHY object that is not a GeometryCollection or FeatureCollection.
geometry_expression_1A GEOMETRY object that is not a GeometryCollection or FeatureCollection.
geometry_expression_2A GEOMETRY object that is not a GeometryCollection or FeatureCollection.
Returns¶
BOOLEAN.
Usage notes¶
For GEOMETRY objects, the function reports an error if the two input GEOMETRY objects have different SRIDs.
Examples¶
GEOGRAPHY examples¶
This shows a simple use of the ST_COVERS function:
GEOMETRY examples¶
The query below shows several examples of using ST_COVERS. Note how the Polygon covers (but does not contain) a LineString on its border.