point = array("x" => $x, "y" => $y); } public function toGml2 () { $str = ""; $str .= $this->point["x"] . "," . $this->point["y"]; $str .= ""; return $str; } public function toGml3 () { $str = ""; $str .= $this->point["x"] . " " . $this->point["y"]; $str .= ""; return $str; } public function isEmpty () { return ($this->point ? false : true); } public function toGeoJSON () { $str = ""; if ($this->point) { $str .= "{\"type\": \"Point\", \"coordinates\":"; if (in_array($this->srs, $this->latLonSrs)) { $str .= "[".$this->point["y"].",".$this->point["x"]."]"; } else { $str .= "[".$this->point["x"].",".$this->point["y"]."]"; } $str .= "}"; } else { $e = new mb_exception("GMLPoint: toGeoJSON: this point is null."); } return $str; } } ?>