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 SRID of the geometry object. |
Limitations
GML fragments only: Accepts GML geometry fragments. Passing a complete GML document returns an error.
No mixed dimensions: GML supports mixed dimensions, but this function does not. If no z coordinate is present, the geometry is converted to a 2D object.
No mixed spatial reference systems: 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.Supported geometry types: polyhedral surfaces, triangles, triangulated irregular network (TIN) surfaces, and 3D objects.
Example
SELECT ST_AsText(ST_GMLToSQL('<Point><coordinates>116,40</coordinates></Point>'));
st_astext
---------------
POINT(116 40)
(1 row)该文章对您有帮助吗?