Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
AsGml (geography Data Type)

AsGml (geography Data Type)

 

Applies To: SQL Server 2014, SQL Server 2016 Preview

Returns the Geography Markup Language (GML) representation of a geography instance.

For more information on Geography Markup Language, see the Open Geospatial Consortium Specification: OGC Specifications, Geography Markup Language.

Applies to: SQL Server (SQL Server 2008 through current version), Azure SQL Database.


.AsGml ( )

SQL Server return type: xml

CLR return type: SqlXml

The following example creates a LineString instance and uses AsGML() to return the GML description of the instance.

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

This method returns the description as a LineString instance.

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

Community Additions

ADD
Show:
© 2015 Microsoft