AsGml (geometry Data Type)

THIS TOPIC APPLIES TO:yesSQL Server (starting with 2008)yesAzure SQL DatabasenoAzure SQL Data Warehouse noParallel Data Warehouse

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

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

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


.AsGml ( )  

Return Types

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 geometry;  
SET @g = geometry::STGeomFromText('LINESTRING(0 0, 0 1, 1 0)', 0)  
SELECT @g.AsGml();  

This method returns the description as a LineString instance.

<LineString xmlns="">  
<posList>0 0 0 1 1 0</posList></LineString>  

See Also

Extended Methods on Geometry Instances