Skip to content

Latest commit

 

History

History
63 lines (44 loc) · 1.68 KB

asgml-geometry-data-type.md

File metadata and controls

63 lines (44 loc) · 1.68 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic f1_keywords helpviewer_keywords dev_langs
AsGml (geometry Data Type)
AsGml (geometry Data Type)
MladjoA
mlandzic
08/03/2017
sql
t-sql
reference
AsGml_(geometry_Data_Type)_TSQL
AsGml_(geometry Data Type)
AsGml (geometry Data Type)
TSQL

AsGml (geometry Data Type)

[!INCLUDE SQL Server Azure SQL Database Azure SQL Managed Instance]

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.

Syntax

.AsGml ( )  

[!INCLUDEsql-server-tsql-previous-offline-documentation]

Return Types

[!INCLUDEssNoVersion] return type: xml

CLR return type: SqlXml

Remarks

Examples

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="http://www.opengis.net/gml">  
<posList>0 0 0 1 1 0</posList></LineString>  

See Also

Extended Methods on Geometry Instances