Test if a geometry value spatially intersects another value.
SELECT ShapeID, "Description" FROM SpatialShapes WHERE NEW ST_LineString( 'LineString( 2 2, 4 4 )' ).ST_Intersects( Shape ) = 1 ORDER BY ShapeID
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 )' )
SQL/MM (ISO/IEC 13249-3: 2006) 5.1.27