Condividi tramite


STUnion (tipo di dati geography)

Restituisce un oggetto che rappresenta l'unione di un'istanza geography con un'altra istanza geography.

Sintassi

.STUnion ( other_geography )

Argomenti

  • other_geography
    Altra istanza geography per formare un'unione con l'istanza sulla quale STUnion() 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 STUnion() per calcolare l'unione di 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.STUnion(@h).ToString();

Vedere anche

Altre risorse