/// Encodes coordinates to the "Encoded Polyline Algorithm Format".
///
/// More info: [https://developers.google.com/maps/documentation/utilities/polylinealgorithm](https://developers.google.com/maps/documentation/utilities/polylinealgorithm)
///
/// `points`: points of the polyline
///
/// `precision`: usually 5 or 6; Google's original algorithm uses 5 digits of decimal precision,
/// which is accurate to about a meter. A precision of 6 gives you an accuracy of about 10cm
///
/// More info: [https://mapzen.com/blog/polyline-precision/](https://mapzen.com/blog/polyline-precision/)
Encodes coordinates to the "Encoded Polyline Algorithm Format".

`points`: points of the polyline

`precision`: usually 5 or 6; Google's original algorithm uses 5 digits of decimal precision,
which is accurate to about a meter. A precision of 6 gives you an accuracy of about 10cm


Encodes coordinates to the " Encoded Polyline Algorithm Format " . ` points ` : points of the polyline ` precision ` : usually 5 or 6 ; Google ' s original algorithm uses 5 digits of decimal precision which is accurate to about a meter . A precision of 6 gives you an accuracy of about 10cm
pub fn encode(points: Vec<Point>, precision: u32) -> String {
    let mut encoded = String::new();
    let mut latitude: f64 = 0.;
    let mut longitude: f64 = 0.;
    for point in points.iter() {
        let poly_latitude = encode_element(point.latitude-latitude, precision);
        encoded += poly_latitude.as_str();
        let poly_longitude = encode_element(point.longitude-longitude, precision);
        encoded += poly_longitude.as_str();
        latitude = point.latitude;
        longitude = point.longitude;
    }
    return encoded;
}
pub fn encode ( points : Vec < Point > , precision : u32 ) -> String { let mut encoded = String :: new ( ) ; let mut latitude : f64 = 0. ; let mut longitude : f64 = 0. ; for point in points . iter ( ) { let poly_latitude = encode_element ( point . latitude - latitude , precision ) ; encoded += poly_latitude . as_str ( ) ; let poly_longitude = encode_element ( point . longitude - longitude , precision ) ; encoded += poly_longitude . as_str ( ) ; latitude = point . latitude ; longitude = point . longitude ; } return encoded ; }
Encodes coordinates to the "Encoded Polyline Algorithm Format".
Encodes coordinates to the " Encoded Polyline Algorithm Format " .
points
Vec<Point>
precision
u32