ST_GeomFromKML

更新时间:
复制 MD 格式

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

ParameterDescription
geomkmlThe 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)