PostGIS
Synopsis
text +`*`+ST_AsKML
*(`geometry `geom
, integer
maxdecimaldigits=15
, text nprefix=NULL`
)`;
text +`*`+ST_AsKML
*(`geography `geog
, integer
maxdecimaldigits=15
, text nprefix=NULL`
)`;
Description
Return the geometry as a Keyhole Markup Language (KML) element. default maximum number of decimal places is 15, default namespace is no prefix.
|
|
|
|
|
|
This function supports 3d and will not drop the z-index.
Examples
SELECT ST_AsKML(ST_GeomFromText('POLYGON((0 0,0 1,1 1,1 0,0 0))',4326));
st_askml
--------
<Polygon><outerBoundaryIs><LinearRing><coordinates>0,0 0,1 1,1 1,0 0,0</coordinates></LinearRing></outerBoundaryIs></Polygon>
--3d linestring
SELECT ST_AsKML('SRID=4326;LINESTRING(1 2 3, 4 5 6)');
<LineString><coordinates>1,2,3 4,5,6</coordinates></LineString>