Condividi tramite


STDifference (tipo di dati geography)

Restituisce un oggetto che rappresenta i punti di un'istanza geography che non si trovano all'interno di un'altra istanza geography.

Sintassi

.STDifference ( other_geography )

Argomenti

  • other_geography
    Altra istanza geography che indica i punti da rimuovere dall'istanza sulla quale STDifference() 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 STDifference() per calcolare la differenza tra due istanze geography.

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

Vedere anche

Altre risorse