Tests if a geometry value is spatially covered by another geometry value.
geometry-expression.ST_CoveredBy(geo2)
Name | Type | Description |
---|---|---|
geo2 |
ST_Geometry |
The other geometry value that is to be compared to the geometry-expression. |
BIT Returns 1 if the geometry-expression covers geo2, otherwise 0.
The ST_CoveredBy method tests if the geometry-expression is completely covered by geo2.
geometry-expression.ST_CoveredBy( geo2 ) is equivalent to geo2.ST_Covers( geometry-expression ).
This predicate is similar to ST_Within except for one subtle difference. The ST_Within predicate requires that one or more interior points of the geometry-expression lie in the interior of geo2. For ST_CoveredBy(), the method returns 1 if no point of the geometry-expression lies outside of geo2, regardless of whether interior points of the two geometries intersect. ST_CoveredBy can be used with geometries in round-Earth spatial reference systems.
If the geometry-expression contains circular strings, then these are interpolated to line strings.
SQL/MM (ISO/IEC 13249-3: 2006) Vendor extension
The following example tests if a point is covered by a polygon. The point is completely covered by the polygon so the example returns 1.
SELECT NEW ST_Point( 1, 1 ) .ST_CoveredBy( NEW ST_Polygon( 'Polygon(( 0 0, 2 0, 1 2, 0 0 ))' ) ) |
The following example tests if a line is covered by a polygon. The line is completely covered by the polygon so the example returns 1. If ST_Within was used in place of ST_CoveredBy, ST_Within would return 0.
SELECT NEW ST_LineString( 'LineString( 0 0, 1 0 )' ) .ST_CoveredBy( NEW ST_Polygon( 'Polygon(( 0 0, 2 0, 1 2, 0 0 ))' ) ) |
The following example lists the ShapeIDs where the given point is
within the Shape geometry. This example returns the result 3,5,6
.
Note that ShapeID 6 is listed even though the point intersects
that row's Shape polygon only at the polygon's boundary.
SELECT LIST( ShapeID ORDER BY ShapeID ) FROM SpatialShapes WHERE NEW ST_Point( 1, 4 ).ST_CoveredBy( Shape ) = 1 |
Discuss this page in DocCommentXchange.
|
Copyright © 2010, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.0 |