You are here

protected function GPX::geometryToGPX in geoPHP 8

Same name and namespace in other branches
  1. 7 geoPHP/lib/adapters/GPX.class.php \GPX::geometryToGPX()
2 calls to GPX::geometryToGPX()
GPX::collectionToGPX in geoPHP/lib/adapters/GPX.class.php
GPX::write in geoPHP/lib/adapters/GPX.class.php
Serialize geometries into a GPX string.

File

geoPHP/lib/adapters/GPX.class.php, line 135

Class

GPX
PHP Geometry/GPX encoder/decoder

Code

protected function geometryToGPX($geom) {
  $type = strtolower($geom
    ->getGeomType());
  switch ($type) {
    case 'point':
      return $this
        ->pointToGPX($geom);
      break;
    case 'linestring':
      return $this
        ->linestringToGPX($geom);
      break;
    case 'polygon':
    case 'multipoint':
    case 'multilinestring':
    case 'multipolygon':
    case 'geometrycollection':
      return $this
        ->collectionToGPX($geom);
      break;
  }
}