Loading TOC...

geokml:to-kml

geokml:to-kml(
   $region as cts:region*,
   [$namespace as xs:string]
) as element()*

Summary

Construct KML elements from cts:region values.

Parameters
region Zero or more cts:region values.
namespace An optional KML namespace URI indicating the version of KML to use when generating output. Default: KML 2.2 (http://www.opengis.net/kml/2.2).

Example

import module namespace geokml="http://marklogic.com/geospatial/kml"
  at "/MarkLogic/geospatial/kml.xqy";
declare namespace kml="http://www.opengis.net/kml/2.2";

geokml:to-kml(
  cts:polygon((
    cts:point(5.0,1.0),cts:point(8.0,1.0),cts:point(8.0,6.0),cts:point(5.0,7.0)
  ))
)

==> A KML polygon similar to the following:
<Polygon xmlns="http://www.opengis.net/kml/2.2">
  <outerBoundaryIs>
    <LinearRing>
      <coordinates>1.0,5.0 1.0,8.0 6.0,8.0 7.0,5.0 1.0,5.0 </coordinates>
    </LinearRing>
  </outerBoundaryIs>
</Polygon>
  

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.