pointArray, array("x" => $x, "y" => $y));
}
public function toGml2 () {
$str = "";
foreach ($this->pointArray as $point) {
$str .= "";
$str .= $point["x"] . "," . $point["y"];
$str .= "";
}
$str .= "";
return $str;
}
public function toGml3 () {
$str = "";
foreach ($this->pointArray as $point) {
$str .= "";
$str .= "" . $point["x"] . " " . $point["y"] . "";
$str .= "";
}
$str .= "";
return $str;
}
public function isEmpty () {
return !(count($this->pointArray) > 0);
}
public function toGeoJSON () {
$numberlineArray = count($this->pointArray);
$str = "";
if ($numberlineArray > 0) {
$str .= "{\"type\": \"MultiPoint\", \"coordinates\":[";
for ($cnt =0; $cnt < $numberlineArray; $cnt++){
if ($cnt > 0) {
$str .= ",";
}
if (in_array($this->srs, $this->latLonSrs)) {
$str .= "[" . $this->pointArray[$cnt]["y"] . "," .
$this->pointArray[$cnt]["x"]."]";
}
else {
$str .= "[" . $this->pointArray[$cnt]["x"] . "," .
$this->pointArray[$cnt]["y"]."]";
}
}
$str .= "]}";
}
else {
$e = new mb_exception("GMLMultiPoint: toGeoJSON: this multiPoint is null.");
}
return $str;
}
}
?>