src/DataTypes/LineString.php
public function lenght($provider = "haversine")
    {
        $length = 0;
        for($i = 0; $i < count($this)-2 ; $i++ ){
            $length += Point::distance($this->points[$i], $this->points[$i+1], $provider);
        }
        return $length;

    }
public function lenght($provider = "haversine")
    {
        $length = 0;
        for($i = 0; $i < count($this)-2 ; $i++ ){
            $length += Point::distance($this->points[$i], $this->points[$i+1], $provider);
        }
        return $length;

    }
public function lenght ( $ provider = "haversine" ) { $ length = 0 ; for ( $ i = 0 ; $ i < count ( $ this ) - 2 ; $ i ++ ) { $ length += Point :: distance ( $ this -> points [ $ i ] , $ this -> points [ $ i + 1 ] , $ provider ) ; } return $ length ; }
Return the lenght of the linestring expressed in meters.

@return int
Return the lenght of the linestring expressed in meters .