Condividi tramite


STIntersects (tipo di dati geometry)

Si applica a:SQL ServerAzure SQL DatabaseAzure SQL Istanza gestitaDatabase SQL in Microsoft Fabric

Restituisce 1 se un'istanza geometry interseca un'altra istanza geometry. In caso contrario, restituisce 0.

Syntax

  
.STIntersects ( other_geometry )  

Arguments

other_geometry
Altra istanza geometry da confrontare con l'istanza sulla quale viene chiamato STIntersects().

Tipi restituiti

Tipo SQL Server restituito: bit

Tipo CLR restituito: SqlBoolean

Remarks

Questo metodo restituisce sempre Null se gli identificatori SRID delle istanze geometry non corrispondono.

Examples

Nell'esempio seguente viene utilizzato STIntersects() per determinare se due istanze geometry si intersecano.

DECLARE @g geometry;  
DECLARE @h geometry;  
SET @g = geometry::STGeomFromText('LINESTRING(0 2, 2 0, 4 2)', 0);  
SET @h = geometry::STGeomFromText('POINT(1 1)', 0);  
SELECT @g.STIntersects(@h);  

Vedere anche

Panoramica degli indici spaziali
Metodi OGC sulle istanze di geometria