Test if a geometry intersects a rectangle.
geometry-expression.ST_IntersectsRect(pmin,pmax)
Name | Type | Description |
---|---|---|
pmin |
ST_Point |
The minimum point value that is to be compared to the geometry-expression. |
pmax |
ST_Point |
The maximum point value that is to be compared to the geometry-expression. |
BIT Returns 1 if the geometry-expression intersects with the specified rectangle, otherwise 0.
The ST_IntersectsRect method tests if a geometry intersects with a specified axis-aligned bounding rectangle.
The method is equivalent to the following: geometry-expression.ST_Intersects( NEW ST_Polygon( pmin, pmax ) )
Therefore, this method can be useful for writing window queries to find all geometries that intersect a given axis-aligned rectangle.
If the geometry-expression contains circularstrings, then these are interpolated to line strings.
SQL/MM (ISO/IEC 13249-3: 2006) Vendor extension
The following example lists the ShapeIDs where the rectangle specified by the envelope of the two points intersects the corresponding
Shape geometry. This example returns the result 3,5,6,18
.
SELECT LIST( ShapeID ORDER BY ShapeID ) FROM SpatialShapes WHERE Shape.ST_IntersectsRect( NEW ST_Point( 0, 4 ), NEW ST_Point( 2, 5 ) ) = 1 |
The following example tests if a linestring intersects a rectangle. The provided linestring does not intersect the rectangle identified by the two points (even though the envelope of the linestring does intersect the envelope of the two points).
SELECT NEW ST_LineString( 'LineString( 0 0, 10 0, 10 10 )' ) .ST_IntersectsRect( NEW ST_Point( 4, 4 ) , NEW ST_Point( 6, 6 ) ) |
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |