geo_wkb_get_kml

geo/includes/geo.wkb.inc, line 123

Versions
6
geo_wkb_get_kml($data, $items = NULL)

KML format. It's actually the same thing as WKT with no post-process.

Code

<?php
function geo_wkb_get_kml($data, $items = NULL) {
  $out = '';
  if (isset($data['x']) && isset($data['y'])) {
    $out = $data['x'] .','. $data['y'];
    if (isset($data['z'])) $out .= ','. $data['z'];
  }
  elseif (isset($data['value'])) {
    $out = $data['value'];
  }

  if (isset($items)) {
    return $items .= "\n". $out;
  }
  return $out;
}
?>