AsGml - tipo di dati geography

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

Restituisce la rappresentazione GML (Geography Markup Language) di un'istanza geography.

Per altre informazioni su Geography Markup Language (GML), vedere la specifica Open Geospatial Consortium: OGC Specifications, Geography Markup Language.

Sintassi

  
.AsGml ( )  

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:xml

Tipo CLR restituito: SqlXml

Osservazioni:

Esempi

Nell'esempio seguente viene creata un'istanza LineString e viene utilizzato AsGML() per restituire la descrizione GML dell'istanza.

DECLARE @g geography;  
SET @g = geography::STGeomFromText('LINESTRING(-122.360 47.656, -122.343 47.656)', 4326);  
SELECT @g.AsGml();  

Questo metodo restituisce la descrizione come istanza LineString.

<LineString xmlns="http://www.opengis.net/gml"><posList>47.656 -122.36 47.656 -122.343</posList></LineString>  

Vedi anche

Metodi estesi sulle istanze di geografia