public function KML::collectionToKML in geoPHP 7
Same name and namespace in other branches
- 8 geoPHP/lib/adapters/KML.class.php \KML::collectionToKML()
1 call to KML::collectionToKML()
- KML::geometryToKML in geoPHP/
lib/ adapters/ KML.class.php
File
- geoPHP/
lib/ adapters/ KML.class.php, line 261
Class
- KML
- PHP Geometry/KML encoder/decoder
Code
public function collectionToKML($geom) {
$components = $geom
->getComponents();
$str = '<' . $this->nss . 'MultiGeometry>';
foreach ($geom
->getComponents() as $comp) {
$sub_adapter = new KML();
$str .= $sub_adapter
->write($comp);
}
return $str . '</' . $this->nss . 'MultiGeometry>';
}