STDimension (type de données geography)STDimension (geography Data Type)

S’APPLIQUE À : ouiSQL Server (à partir de 2008) ouiAzure SQL Database nonAzure SQL Data Warehouse nonParallel Data Warehouse APPLIES TO: yesSQL Server (starting with 2008) yesAzure SQL Database noAzure SQL Data Warehouse noParallel Data Warehouse

Retourne la dimension maximale d’une instance geography.Returns the maximum dimension of a geography instance.

SyntaxeSyntax

  
.STDimension ( )  

Types de retourReturn Types

Type de retour SQL ServerSQL Server : intSQL ServerSQL Server return type: int

Type de retour CLR : SqlInt32CLR return type: SqlInt32

Notes Remarks

STDimension() retourne -1 si l’instance geography est vide.STDimension() returns -1 if the geography instance is empty.

ExemplesExamples

L’exemple suivant utilise STDimension() pour créer une variable de table destinée à contenir des instances geography, et insère Point, LineString, ainsi que Polygon.The following example uses STDimension() to create a table variable to hold geography instances, and inserts a Point, a LineString, and a 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;  

L’exemple retourne ensuite les dimensions de chaque instance geography.The example then returns the dimensions of each geographyinstance.

NAMEname dimdim
PointPoint 00
LineStringLineString 11
PolygonPolygon 22

 Voir aussiSee Also

Méthodes OGC sur des instances geographyOGC Methods on Geography Instances