src/DataTypes/Polygon.php
public static function fromString($linestrings, $linestrings_separator = ";", $points_separator = ",", $coords_separator = " ")
    {
        $separators = [$linestrings_separator, $points_separator, $coords_separator];
        if(sizeof($separators) != sizeof(array_unique($separators)))
            throw new GeoSpatialException("Error: separators must be different");

        $parsed_linestrings = array_map(function($linestring) use ($points_separator, $coords_separator){
            return LineString::fromString($linestring, $points_separator, $coords_separator);
        }, explode($linestrings_separator, trim($linestrings)));

        return new static($parsed_linestrings);
    }
public static function fromString($linestrings, $linestrings_separator = ";", $points_separator = ",", $coords_separator = " ")
    {
        $separators = [$linestrings_separator, $points_separator, $coords_separator];
        if(sizeof($separators) != sizeof(array_unique($separators)))
            throw new GeoSpatialException("Error: separators must be different");

        $parsed_linestrings = array_map(function($linestring) use ($points_separator, $coords_separator){
            return LineString::fromString($linestring, $points_separator, $coords_separator);
        }, explode($linestrings_separator, trim($linestrings)));

        return new static($parsed_linestrings);
    }
public static function fromString ( $ linestrings , $ linestrings_separator = ";" , $ points_separator = "," , $ coords_separator = " " ) { $ separators = [ $ linestrings_separator , $ points_separator , $ coords_separator ] ; if ( sizeof ( $ separators ) != sizeof ( array_unique ( $ separators ) ) ) throw new GeoSpatialException ( "Error: separators must be different" ) ; $ parsed_linestrings = array_map ( function ( $ linestring ) use ( $ points_separator , $ coords_separator ) { return LineString :: fromString ( $ linestring , $ points_separator , $ coords_separator ) ; } , explode ( $ linestrings_separator , trim ( $ linestrings ) ) ) ; return new static ( $ parsed_linestrings ) ; }
A Polygon could be instantiated using a string containing linestrings.
es. "lat lon, lat lon; lat lon, lat lon; lat lon, lat lon"

@param $linestrings
@param $linestrings_separator
@param $points_separator
@param $coords_separator
@return Polygon
@throws GeoSpatialException
A Polygon could be instantiated using a string containing linestrings . es . lat lon lat lon ; lat lon lat lon ; lat lon lat lon