STDimension (tipo di dati geography)

Si applica a:SQL Server database SQL di Azure Istanza gestita di SQL di Azure

Restituisce le dimensioni massime di un'istanza geography.

Sintassi

  
.STDimension ( )  

Nota

Per visualizzare la sintassi Transact-SQL per SQL Server 2014 (12.x) e versioni precedenti, vedere la documentazione delle versioni precedenti.

Tipi restituiti

Tipo SQL Server restituito: int

Tipo CLR restituito: SqlInt32

Osservazioni:

STDimension() restituisce -1 se l'istanza geography è vuota.

Esempi

L'esempio seguente usa STDimension() per creare una variabile di tabella per contenere le istanze geography e inserisce un valore Point, un valore LineString e un valore Polygon.

DECLARE @temp table ([name] varchar(10), [geom] geography);  
  
INSERT INTO @temp values ('Point', geography::STGeomFromText('POINT(-122.34900 47.65100)', 4326));  
INSERT INTO @temp values ('LineString', geography::STGeomFromText('LINESTRING(-122.360 47.656, -122.343 47.656)', 4326));  
INSERT INTO @temp values ('Polygon', geography::STGeomFromText('POLYGON((-122.358 47.653, -122.348 47.649, -122.348 47.658, -122.358 47.658, -122.358 47.653))', 4326));  
  
SELECT [name], [geom].STDimension() as [dim]  
FROM @temp;  

Nell'esempio vengono restituite le dimensioni di ogni istanza geography.

name dim
Point 0
LineString 1
Polygon 2

Vedi anche

Metodi OGC sulle istanze di geografia