ST_AsKML

Determine the Keyhole Markup Language (KML) representation of a geometry.

Syntax

ST_AsKML(geo[, kmlAttributes]);
geo
The input geometry.

Type: VARCHAR(ANY)

kmlAttributes
One or more of the following optional KML attributes:
  • <extrude>
  • <tessellate>
  • <altitudeMode>
These attributes are not validated; they are added to the output exactly as they are specified for the function.

Type: VARCHAR(ANY)

Returns

A value of type VARCHAR(ANY) that contains the KML representation of the input geometry.

Examples

SELECT inza..ST_AsKML(inza..ST_Point(1, 5));

ST_ASKML
----------
<Point><coordinates>1,5</coordinates></Point> 
(1 row)
SELECT inza..ST_AsKML(inza..ST_Point(1, 5),
            '<extrude>1</extrude><altitudeMode>clampToGround</altitudeMode>');

ST_ASKML
----------
<Point><extrude>1</extrude><altitudeMode>clampToGround</altitudeMode><coordinates>1,5</coordinates></Point> 
(1 row)