pub fn distance_from_nearest_point(&self, point: &Coord) -> (f64, Coord) {
        let mut min: (f64, Point) = (std::f64::MAX, Point{lat: 0.0, lon: 0.0});
        for segment in &self.into_segments() {
            let tmp = segment.distance_from_point(&point);
            if tmp.0 < min.0 {
                min = tmp;
            }
        }
        min
    }
/// Get a tuple containing the distance from the nearest point of the road and the coordinates of the said point
Get a tuple containing the distance from the nearest point of the road and the coordinates of the said point
Get a tuple containing the distance from the nearest point of the road and the coordinates of the said point
pub fn distance_from_nearest_point(&self, point: &Coord) -> (f64, Coord) {
        let mut min: (f64, Point) = (std::f64::MAX, Point{lat: 0.0, lon: 0.0});
        for segment in &self.into_segments() {
            let tmp = segment.distance_from_point(&point);
            if tmp.0 < min.0 {
                min = tmp;
            }
        }
        min
    }
pub fn distance_from_nearest_point ( & self , point : & Coord ) -> ( f64 , Coord ) { let mut min : ( f64 , Point ) = ( std :: f64 :: MAX , Point { lat : 0.0 , lon : 0.0 } ) ; for segment in & self . into_segments ( ) { let tmp = segment . distance_from_point ( & point ) ; if tmp . 0 < min . 0 { min = tmp ; } } min }
Get a tuple containing the distance from the nearest point of the road and the coordinates of the said point
Get a tuple containing the distance from the nearest point of the road and the coordinates of the said point
&self
point
&Coord
&self
point
&Coord