Constructs a geometry object from a Geography Markup Language (GML) string.
Syntax
geometry ST_GeomFromGML(text geomgml);
geometry ST_GeomFromGML(text geomgml, integer srid);Parameters
| Parameter | Description |
|---|---|
geomgml | The GML string. |
srid | The spatial reference identifier (SRID) of the geometry object. |
Usage notes
Accepts GML geometry fragments only. Passing a complete GML document returns an error.
GML supports mixed dimensions, but this function does not. If no z coordinate is found, the function returns a 2D object.
GML supports mixed spatial reference systems (SRSs), but this function does not. All sub-geometries are reprojected to the SRS of the root node. If the GML root node has no
srsNameattribute, the function returns an error.Supports polyhedral surfaces, triangles, triangulated irregular network (TIN) surfaces, and 3D objects.
Examples
SELECT ST_AsText(ST_GeomFromGML('<gml:Point srsName="EPSG:4326"><gml:coordinates>116,40</gml:coordinates></gml:Point>'));
st_astext
---------------
POINT(116 40)
(1 row)