Condividi tramite


STIntersects (tipo di dati geography)

Si applica a:SQL ServerDatabase SQL di AzureIstanza gestita di SQL di AzureDatabase SQL in Microsoft Fabric

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

Syntax

.STIntersects ( other_geography )  

Arguments

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

Remarks

Questo metodo restituisce sempre NULL se gli identificatori SRID delle istanze geography non corrispondono.

Examples

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;

Vedere anche

Metodi OGC sulle istanze di geografia