STSymDifference (tipo di dati geography)
Restituisce un oggetto che rappresenta tutti i punti che si trovano in un'istanza geography o un un'altra istanza geography, ma non quelli punti che si trovano in entrambi le istanze.
Sintassi
.STSymDifference ( other_geography )
Argomenti
- other_geography
Altra istanza geography oltre all'istanza sulla quale STSymDistance() viene richiamato.
Tipi restituiti
Tipo SQL Server restituito: geographygeography
Tipo CLR restituito: SqlGeographySqlGeography
Osservazioni
Questo metodo restituisce sempre Null se gli identificatori SRID delle istanze geography non corrispondono.
Esempi
Nell'esempio seguente viene utilizzato STSymDifference() per calcolare la differenza simmetrica tra due istanze Polygon.
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('POLYGON((-122.351 47.656, -122.341 47.656, -122.341 47.661, -122.351 47.661, -122.351 47.656))', 4326);
SELECT @g.STSymDifference(@h).ToString();