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 geometry fragment string. |
srid | The spatial reference identifier (SRID) of the output geometry object. |
Supported geometry types
Polyhedral surfaces
Triangles
Triangulated irregular network (TIN) surfaces
3D objects
Limitations
GML geometry fragments only: Pass a GML geometry fragment, not a complete GML document. Passing a full GML document returns an error.
No mixed dimensions: GML supports mixed dimensions, but this function does not. If no Z coordinate is found, the function converts the output to a 2D object.
No mixed spatial reference systems (SRSs): GML supports mixed SRSs, but this function does not. The function reprojects all sub-geometries to the SRS of the root node. If the GML root node has no
srsNameattribute, the function returns an error.
Examples
Parse a point geometry
SELECT ST_AsText(ST_GeomFromGML('<gml:Point srsName="EPSG:4326"><gml:coordinates>116,40</gml:coordinates></gml:Point>'));Output:
st_astext
---------------
POINT(116 40)
(1 row)该文章对您有帮助吗?