private function GeoRSS::polygonToGeoRSS in geoPHP 7
Same name and namespace in other branches
- 8 geoPHP/lib/adapters/GeoRSS.class.php \GeoRSS::polygonToGeoRSS()
File
- geoPHP/
lib/ adapters/ GeoRSS.class.php, line 221
Class
- GeoRSS
- PHP Geometry/GeoRSS encoder/decoder
Code
private function polygonToGeoRSS($geom) {
$output = '<' . $this->nss . 'polygon>';
$exterior_ring = $geom
->exteriorRing();
foreach ($exterior_ring
->getComponents() as $k => $point) {
$output .= $point
->getY() . ' ' . $point
->getX();
if ($k < $exterior_ring
->numGeometries() - 1) {
$output .= ' ';
}
}
$output .= '</' . $this->nss . 'polygon>';
return $output;
}