You are here

private function KML::geometryToKML in geoPHP 8

Same name and namespace in other branches
  1. 7 geoPHP/lib/adapters/KML.class.php \KML::geometryToKML()
1 call to KML::geometryToKML()
KML::write in geoPHP/lib/adapters/KML.class.php
Serialize geometries into a KML string.

File

geoPHP/lib/adapters/KML.class.php, line 187

Class

KML
PHP Geometry/KML encoder/decoder

Code

private function geometryToKML($geom) {
  $type = strtolower($geom
    ->getGeomType());
  switch ($type) {
    case 'point':
      return $this
        ->pointToKML($geom);
      break;
    case 'linestring':
      return $this
        ->linestringToKML($geom);
      break;
    case 'polygon':
      return $this
        ->polygonToKML($geom);
      break;
    case 'multipoint':
    case 'multilinestring':
    case 'multipolygon':
    case 'geometrycollection':
      return $this
        ->collectionToKML($geom);
      break;
  }
}