Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
测试某几何值是否在空间上与其它值相交。
geometry-expression.ST_Intersects(geo2)
geo2
ST_Geometry
要与 geometry-expression 进行比较的另一个几何值。
BIT 如果 geometry-expression 在空间上与 geo2 相交,则返回 1,否则返回 0。
测试某几何值是否在空间上与其它值相交。当两个几何共享一个或多个共有点时,二者相交。
geometry-expression.ST_Intersects( geo2 ) = 1 等效于 geometry-expression.ST_Disjoint( geo2 ) = 0。
如果 geometry-expression 包含圆弧线串,则将这些圆弧线串内插到线串中。
SQL/MM (ISO/IEC 13249-3: 2006) 5.1.27
以下示例将为每个与指定线相交的 shape 返回一个结果行。
SELECT ShapeID, "Description" FROM SpatialShapes WHERE NEW ST_LineString( 'LineString( 2 2, 4 4 )' ).ST_Intersects( Shape ) = 1 ORDER BY ShapeID
该示例返回以下结果集:
2
Square
3
Rectangle
5
L shape line
18
CircularString
22
Triangle
要直观地表示 SpatialShapes 表中的几何如何与上例中的线相交,可以在 Interactive SQL 空间查看器中执行以下查询。
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 )' )