pypolyline provides fast Google Polyline encoding and decoding functionalities, leveraging Rust FFI for performance. It is currently at version 0.5.6 and maintains an active, albeit irregular, release cadence with minor updates addressing improvements and bug fixes.
pip install pypolylineVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to encode a list of (latitude, longitude) tuples into a Google Polyline string and decode a Polyline string back into a list of points. The `precision` parameter is crucial for correct encoding/decoding, with `5` being standard for Google Polylines.
Replace `factor=1e5` (or similar) with `precision=5` (or the corresponding precision) in your calls to `encode` and `decode`.
Ensure you have a Rust toolchain installed (e.g., using `rustup`) if `pip install pypolyline` fails with compiler-related errors. Alternatively, try to use a Python version/OS for which wheels are pre-built (Linux, macOS, Windows are generally well-supported).
For standard Google Polylines, always use `precision=5`. If working with custom polyline specifications, ensure the `precision` matches the expected decimal places of the coordinate components.
No dependency data recorded yet.