Skip to content

Repository files navigation

polyline-rs

Python Free-Threaded CompatiblePyPI - Python VersionLiberapay PatronsGitHub Sponsors

Fast Google Encoded Polyline encoding & decoding in Rust with Python bindings. Library with out-of-the-box support for both (lat, lon) and (lon, lat) coordinates.

Encoded Polyline Algorithm Format

Installation

Pre-built binary wheels are available for Linux, macOS, and Windows, with support for both x64 and ARM architectures.

pip install polyline-rs

Basic usage

frompolyline_rsimportencode_latlon, encode_lonlat, decode_latlon, decode_lonlatline=encode_latlon([(38.5, -120.2), (40.7, -120.95), (43.252, -126.453)], 5)
assertline=="_p~iF~ps|U_ulLnnqC_mqNvxq`@"coords=decode_latlon(line, 5)
assertcoords== [(38.5, -120.2), (40.7, -120.95), (43.252, -126.453)]
coords2=decode_lonlat(line, 5)
assertcoords2== [(-120.2, 38.5), (-120.95, 40.7), (-126.453, 43.252)]

About

Fast Google Encoded Polyline encoding & decoding in Rust for Python

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Used by

Contributors

Languages