Constructs a geometry object from a Keyhole Markup Language (KML) string defined by the Open Geospatial Consortium (OGC).
Syntax
geometry ST_GeomFromKML(text geomkml);Parameters
| Parameter | Description |
|---|---|
geomkml | The KML string. |
Usage notes
Accepts only KML geometry fragments. Passing a complete KML document returns an error.
Supports 3D geometries and preserves the z-coordinate of the constructed geometry object.
Examples
SELECT ST_AsText(ST_GeomFromKML('<Point><coordinates>116,40</coordinates></Point>'));Output:
st_astext
---------------
POINT(116 40)
(1 row)该文章对您有帮助吗?