polyline
Fast Google Encoded Polyline encoding & decoding in Rust.
Example
use polyline;
use line_string;
let coord = line_string!;
let output = "_p~iF~ps|U_ulLnnqC_mqNvxq`@";
let result = encode_coordinates.unwrap;
assert_eq!
A Note on Coordinate Order
This crate uses Coord
and LineString
types from the geo-types
crate, which encodes coordinates in (x, y)
/ (lon, lat)
order. The Polyline algorithm and its first-party documentation assumes the opposite coordinate order. It is thus advisable to pay careful attention to the order of the coordinates you use for encoding and decoding.
FFI
C-compatible FFI bindings for this crate are provided by the polyline-ffi crate.