Nombre

ST_GeomFromKML — Toma una representación de una geometría KML de entrada y devuelve un objeto geométrico PostGIS

Sinopsis

geometry ST_GeomFromKML(text geomkml);

Descripción

Constructs a PostGIS geometry from an OGC KML representation.

ST_GeomFromKML solo funciona con fragmentos geométricos KML. Devuelve un error si intentas utilizar un documento KML completo.

Versiones soportadas OGC KML:

  • 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.

[Nota]

ST_GeomFromKML does not support SQL/MM curve geometries.

Ejemplos

A single LineString geometry.

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

                
Output
SRID=4326;LINESTRING(-71.1663 42.2614,-71.1667 42.2616)
Figure
Geometry figure for visual-st-geomfromkml-01