polyline_rust 0.1.1

Crate to encode/decode polylines in "Encoded Polyline Algorithm Format".
Documentation
  • Coverage
  • 81.82%
    9 out of 11 items documented1 out of 9 items with examples
  • Size
  • Source code size: 16.18 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.59 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • marinewater

polyline_rust

Crate to encode/decode polylines in "Encoded Polyline Algorithm Format"

Usage example:

use polyline_rust::{Point, encode, decode};

fn main() {
    let polyline = encode(vec![
        Point::new(12.34567, 89.01234),
        Point::new(12.34891, 89.01567),
        Point::new(12.35678, 89.01891),
    ], 5);
    println!("{}", polyline); // output: "mgjjAcfh~OgSySep@gS"

    let coordinates = decode(&polyline, 5);
    for point in coordinates {
        println!("{}, {}", point.latitude, point.longitude);
    }
    /*
        output:
            12.34567, 89.01234
            12.34891, 89.01567
            12.35678, 89.01891
     */
}