Name

ST_AsGML — Returns the Geography Markup Language (GML) representation of a Geometry object.

Synopsis

varchar ST_AsGML(bytea Geometry);

Alias

AsGML

Description

Returns the GML representation of a Geometry object. The GML supported version is 2.

For a full description of GML geometries, refer to http://www.opengeospatial.org/standards/gml

Coordinate Dimensions
2D3DM
Spatial Standards Support
OGC SFS for SQL. 1.1 (1999)OGC SFS for SQL. 1.1.0 (2005)OGC SFS for SQL. 1.2.0 (2006)SQL-MM Part 3
---5.1.39

Examples

SELECT ST_AsGML(ST_GeomFromText('POINT(1 1 1)',25830));

<gml:Point srsName="EPSG:25830">
  <gml:coordinates>
    1.0,1.0,1.0
  </gml:coordinates>
</gml:Point>


SELECT ST_AsGML(ST_GeomFromEWKT('SRID=25830;POLYGON ((1 1, 1 3, 2 4, 3 3, 1 1))'));

<gml:Polygon>
  <gml:outerBoundaryIs>
    <gml:LinearRing>
      <gml:coordinates>
        1.0,1.0 1.0,3.0 2.0,4.0 3.0,3.0 1.0,1.0
      </gml:coordinates>
    </gml:LinearRing>
  </gml:outerBoundaryIs>
</gml:Polygon>

Related functions

ST_GeomFromGML