STIntersects (tipo di dati geometry)

Si applica a:SQL Server database SQL di Azure Istanza gestita di SQL di Azure Endpoint di analisiSQL in Microsoft FabricWarehouse in Microsoft Fabric

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

Sintassi

  
.STIntersects ( other_geometry )  

Nota

Per visualizzare la sintassi Transact-SQL per SQL Server 2014 (12.x) e versioni precedenti, vedere la documentazione delle versioni precedenti.

Argomenti

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

Osservazioni:

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

Esempi

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);  

Vedi anche

Panoramica degli indici spaziali
Metodi OGC sulle istanze di geometria