You are here

public function KML::write in geoPHP 8

Same name and namespace in other branches
  1. 7 geoPHP/lib/adapters/KML.class.php \KML::write()

Serialize geometries into a KML string.

Parameters

Geometry $geometry:

Return value

string The KML string representation of the input geometries

Overrides GeoAdapter::write

File

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

Class

KML
PHP Geometry/KML encoder/decoder

Code

public function write(Geometry $geometry, $namespace = FALSE) {
  if ($namespace) {
    $this->namespace = $namespace;
    $this->nss = $namespace . ':';
  }
  return $this
    ->geometryToKML($geometry);
}