Partager via


AsGml (type de données geometry)

Retourne la représentation GML (Geography Markup Language) d'une instance geometry.

Pour plus d'informations sur le langage GML, consultez la spécification suivante d'Open Geospatial Consortium :OGC Specifications, Geography Markup Language.

Syntaxe

.AsGml ( )

Types des valeurs de retour

SQL Server type de retour : xml

Type de retour CLR : SqlXml

Exemples

L'exemple suivant crée une instance LineString et utilise AsGML() pour retourner la description GML de l'instance.

DECLARE @g geometry;
SET @g = geometry::STGeomFromText('LINESTRING(0 0, 0 1, 1 0)', 0)
SELECT @g.AsGml();

Cette méthode retourne la description en tant qu'instance LineString.

<LineString xmlns="http://www.opengis.net/gml">
<posList>0 0 0 1 1 0</posList></LineString>