STIntersects (tipo di dati geography)

Si applica a:SQL Server database SQL di Azure Istanza gestita di SQL di Azure

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

Sintassi

.STIntersects ( other_geography )  

Nota

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

Argomenti

other_geography
Altra istanza geography 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 geography non corrispondono.

Esempi

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

 DECLARE @g geography;  
 DECLARE @h geography;  
 SET @g = geography::STGeomFromText('POLYGON((-122.358 47.653, -122.348 47.649, -122.348 47.658, -122.358 47.658, -122.358 47.653))', 4326);  
 SET @h = geography::STGeomFromText('LINESTRING(-122.360 47.656, -122.343 47.656)', 4326);  
SELECT CASE @g.STIntersects(@h) 
WHEN 1 THEN '@g intersects @h'  
ELSE '@g does not intersect @h'  
END;

Vedi anche

Metodi OGC sulle istanze di geografia