This topic describes the ST_GMLToSQL function. This function constructs a geometry object by using 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 |
|---|---|
| geomkml | The Keyhole Markup Language (KML) string that you want to specify. |
| srid | The spatial reference identifier (SRID) of the geometry object. |
Description
- This function supports only GML geometry fragments. If you use this function on an entire GML document, this function returns an error.
- GML supports mixed dimensions. This function does not support mixed dimensions. If no z coordinate is found, this function converts the geometry object that is constructed into a 2D object.
- GML supports mixed spatial reference systems (SRSs). This function does not support mixed SRSs. This function reprojects all sub-geometries to the SRS root node. If no srsName attribute is available for the GML root node, this function returns an error.
- This function 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)