src/DataTypes/LineString.php
public static function fromString($points, $points_separator = ",", $coords_separator = " ")
    {
        if($points_separator == $coords_separator)
            throw new GeoSpatialException("Error: separators must be different");
        $parsed_points = array_map(function($p) use ($coords_separator){
            return Point::fromString($p, $coords_separator);
        }, explode($points_separator, trim($points)));
        return new static($parsed_points);
    }
public static function fromString($points, $points_separator = ",", $coords_separator = " ")
    {
        if($points_separator == $coords_separator)
            throw new GeoSpatialException("Error: separators must be different");
        $parsed_points = array_map(function($p) use ($coords_separator){
            return Point::fromString($p, $coords_separator);
        }, explode($points_separator, trim($points)));
        return new static($parsed_points);
    }
public static function fromString ( $ points , $ points_separator = "," , $ coords_separator = " " ) { if ( $ points_separator == $ coords_separator ) throw new GeoSpatialException ( "Error: separators must be different" ) ; $ parsed_points = array_map ( function ( $ p ) use ( $ coords_separator ) { return Point :: fromString ( $ p , $ coords_separator ) ; } , explode ( $ points_separator , trim ( $ points ) ) ) ; return new static ( $ parsed_points ) ; }
A Linestring could be instantiated using a string where points are divided by a "," and coordinates
are divided by " ". Separators must be different.
es. "lat lon, lat lon"

@param $points
@param string $points_separator
@param string $coords_separator
@throws GeoSpatialException
@return LineString
A Linestring could be instantiated using a string where points are divided by a and coordinates are divided by . Separators must be different . es . lat lon lat lon