Skip to content

Commit

Permalink
Fixing up KML output. Using capitals
Browse files Browse the repository at this point in the history
  • Loading branch information
phayes committed Apr 13, 2011
1 parent 6e78ff5 commit 26af16a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/adapters/KML.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,17 @@ private function geometryToKML($geom) {
}

private function pointToKML($geom) {
return "<point><coordinates>".$geom->getX().",".$geom->getY()."</coordinates></point>";
return "<Point><coordinates>".$geom->getX().",".$geom->getY()."</coordinates></Point>";
}

private function linestringToKML($geom) {
$type = strtolower($geom->getGeomType());
$type = $geom->getGeomType();
$str = '<'. $type .'><coordinates>';
$i=0;
foreach ($geom->getComponents() as $comp) {
if ($i != 0) $str .= ' ';
$str .= $comp->getX() .','. $comp->getY();
$i++;
}

return $str .'</coordinates></'. $type .'>';
Expand All @@ -216,7 +219,7 @@ public function polygonToKML($geom) {
$str .= '<innerBoundaryIs>' . $this->linestringToKML($comp) . '</innerBoundaryIs>';
}

return '<polygon>'. $str .'</polygon>';
return '<Polygon>'. $str .'</Polygon>';
}

public function collectionToKML($geom) {
Expand Down

0 comments on commit 26af16a

Please sign in to comment.