PostGIS

ST_GeomFromKML

Prev

7.8.3. Other Formats

Next

Name

ST_GeomFromKML — Takes as input KML representation of geometry and outputs a PostGIS geometry object

Synopsis

+geometry +ST_GeomFromKML(+`text `+geomkml`)`;

Description

Constructs a PostGIS ST_Geometry object from the 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

Availability: 1.5, requires libxml2 2.6+

check This function supports 3d and will not drop the z-index.

Note

ST_GeomFromKML function not support SQL/MM curves geometries.

Examples - A single geometry with srsName

SELECT ST_GeomFromKML('
        <LineString>
            <coordinates>-71.1663,42.2614
                -71.1667,42.2616</coordinates>
        </LineString>');

See Also

Prev

Up

Next

ST_GeomFromGeoJSON

Home

ST_GeomFromTWKB