Test if a geometry value spatially intersects another value.
Syntaxgeometry-expression.ST_Intersects(geo2)
Parameters| Name | Type | Description |
|---|---|---|
|
geo2 |
ST_Geometry |
The other geometry value that is to be compared to the geometry-expression. |
ReturnsBIT Returns 1 if the geometry-expression spatially intersects with geo2, otherwise 0.
RemarksTests if a geometry value spatially intersects another value. Two geometries intersect if they share one or more common points.
geometry-expression.ST_Intersects( geo2 ) = 1 is equivalent to geometry-expression.ST_Disjoint( geo2 ) = 0.
If the geometry-expression contains circularstrings, then these are interpolated to line strings.
See also
Standards and compatibilitySQL/MM (ISO/IEC 13249-3: 2006) 5.1.27
ExampleThe following example returns a result with one row for each shape that intersects the specified line.
SELECT ShapeID, "Description" FROM SpatialShapes WHERE NEW ST_LineString( 'LineString( 2 2, 4 4 )' ).ST_Intersects( Shape ) = 1 ORDER BY ShapeID |
The example returns the following result set:
| ShapeID | Description |
|---|---|
2 |
Square |
3 |
Rectangle |
5 |
L shape line |
18 |
CircularString |
22 |
Triangle |
To visualize how the geometries in the SpatialShapes table intersect the line in the above example, execute the following query in the Interactive SQL Spatial Viewer.
SELECT Shape FROM SpatialShapes WHERE NEW ST_LineString( 'LineString( 2 2, 4 4 )' ).ST_Intersects( Shape ) = 1 UNION ALL SELECT NEW ST_LineString( 'LineString( 2 2, 4 4 )' ) |
![]() |
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |
