ST_GeomFromKML — Takes as input KML representation of geometry and outputs a PostGIS geometry object
geometry ST_GeomFromKML(text geomkml);
Constructs a PostGIS geometry from an OGC KML representation.
ST_GeomFromKML works only for KML Geometry fragments. It throws an error if you try to use it on a whole KML document.
OGC KML versions supported:
KML 2.2.0 Namespace
OGC KML standards, cf: http://www.opengeospatial.org/standards/kml:
Availability: 1.5, requires libxml2 2.6+
This function supports 3d and will not drop the z-index.
|
|
|
ST_GeomFromKML does not support SQL/MM curve geometries. |
A single LineString geometry.
SELECT ST_AsEWKT(ST_GeomFromKML($$ <LineString> <coordinates>-71.1663, 42.2614 -71.1667, 42.2616</coordinates> </LineString> $$));
SRID=4326;LINESTRING(-71.1663 42.2614,-71.1667 42.2616)