/** * @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; }
/** * @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; }