Constructs a geometry object from an Open Geospatial Consortium (OGC) Geography Markup Language (GML) string.
Syntax
geometry ST_GMLToSQL(text geomgml);
geometry ST_GMLToSQL(text geomgml, integer srid);Parameters
| Parameter | Description |
|---|---|
geomgml | The Geography Markup Language (GML) string to parse. |
srid | The spatial reference identifier (SRID) of the geometry object. |
Usage notes
Accepts only GML geometry fragments. Passing a complete GML document returns an error.
Does not support mixed dimensions. If no z coordinate is present, the resulting geometry is treated as a 2D object.
Does not support mixed spatial reference systems (SRSs). 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_GMLToSQL('<Point><coordinates>116,40</coordinates></Point>'));
st_astext
---------------
POINT(116 40)
(1 row)该文章对您有帮助吗?