features[]=$geo; } } class Geometry { var $type; var $coordinates; } class Geofeature { var $type="Feature"; var $id; var $geometry; var $properties; function addProperties($name,$value) { @$this->properties->$name=$value; } } class GeoBox extends Geometry { function __construct($minx,$miny,$maxx,$maxy) { $this->type='Polygon'; $this->coordinates=array(array(array($minx,$miny),array($minx,$maxy),array($maxx,$maxy),array($maxx,$miny),array($minx,$miny))); } } class GeoBoxLine extends Geometry { function __construct($minx,$miny,$maxx,$maxy) { $this->type='LineString'; $this->coordinates=array(array($minx,$miny),array($minx,$maxy),array($maxx,$maxy),array($maxx,$miny),array($minx,$miny)); } }