Condividi tramite


STIntersection (tipo di dati geography)

Restituisce un oggetto che rappresenta i punti in cui un'istanza geography interseca un'altra istanza geography.

Sintassi

.STIntersection ( other_geography )

Argomenti

  • other_geography
    Altra istanza geography da confrontare con l'istanza sulla quale STIntersection() è richiamato per determinare il punto di intersezione.

Tipi restituiti

Tipo SQL Server restituito: geographygeography

Tipo CLR restituito: SqlGeographySqlGeography

Osservazioni

STIntersection() restituisce sempre Null se gli identificatori SRID delle istanze geography non corrispondono.

Esempi

Nell'esempio seguente viene utilizzato STIntersection() per calcolare l'intersezione tra Polygon e LineString.

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 @g.STIntersection(@h).ToString();

Vedere anche

Altre risorse