About
Zero-dependency Rust crate for encoding and decoding Google's polyline format.
Compared to the georust/polyline crate, the polyline-iter
decodes polyline into an iterator over points instead of vector, which is benefitial when only a single iteration over the polyline is needed. And in such cases it performs twice as fast as the georust/polyline
crate and has no hidden allocations.
Usage
Add this to your Cargo.toml
:
[]
= "0.3"
Example
use PolylineIter;
let iter = new;
assert_eq!;
// If the points are not needed, the iterator can be used directly
assert_eq!;
// Iterator approach allows to transcode polyline to another precision without intermediate allocations.
let polyline5 = encode;
assert_eq!;
assert_eq!;
// Keeping all the power of working with slices
let points = vec!;
assert_eq!;
License
All code in this project is dual-licensed under either:
at your option.