public function jsonSerialize()
    {
        $linearrings = [];
        foreach ($this->linestrings as $linestring) {
            $linearrings[] = new \GeoJson\Geometry\LinearRing($linestring->jsonSerialize()->getCoordinates());
        }

        return new \GeoJson\Geometry\Polygon($linearrings);
    }
public function jsonSerialize()
    {
        $linearrings = [];
        foreach ($this->linestrings as $linestring) {
            $linearrings[] = new \GeoJson\Geometry\LinearRing($linestring->jsonSerialize()->getCoordinates());
        }

        return new \GeoJson\Geometry\Polygon($linearrings);
    }
public function jsonSerialize ( ) { $ linearrings = [ ] ; foreach ( $ this -> linestrings as $ linestring ) { $ linearrings [ ] = new \ GeoJson \ Geometry \ LinearRing ( $ linestring -> jsonSerialize ( ) -> getCoordinates ( ) ) ; } return new \ GeoJson \ Geometry \ Polygon ( $ linearrings ) ; }
Convert to GeoJson Polygon that is jsonable to GeoJSON

@return \GeoJson\Geometry\Polygon
Convert to GeoJson Polygon that is jsonable to GeoJSON