Example #1
0
 /**
  * @param \stdClass $geojson
  *
  * @return GeoJson
  */
 public static function fromGeoJson(\stdClass $geojson)
 {
     $gj = new self();
     foreach ($geojson->features as $feature) {
         $gj->addFeature(Feature::fromGeoJson($feature->coordinates));
     }
     return $gj;
 }
Example #2
0
 /**
  * @param $shapeMultiPolygon
  *
  * @return $this
  */
 public function setShapeMultipolygon($shapeMultiPolygon = null)
 {
     if (is_null($shapeMultiPolygon)) {
         return $this;
     }
     $this->setFeature(Feature::fromGeoJson(json_decode($shapeMultiPolygon)));
     $this->shapeMultipolygon = $shapeMultiPolygon;
     return $this;
 }