flexpolyline
Flexible Polyline encoding: a lossy compressed representation of a list of coordinate pairs or triples
What it is and what it does
FlexPolyline is a Python implementation of the Flexible Polyline encoding standard, a lossy compression format for geographic coordinate sequences. It reduces coordinate data by rounding decimal precision, encoding only offsets from the previous point, using variable-length encoding, and representing the result in URL-safe characters. The package provides symmetric encode/decode operations for both 2D (latitude, longitude) and 3D coordinates (with altitude, elevation, level, or custom dimensions), and supports both tuple and dictionary input/output formats.
The primary use case is compressing GPS traces, route paths, or other coordinate-heavy geographic data for efficient storage or transmission. With no external dependencies and a simple API, it integrates easily into mapping applications, location services, or any system that needs to serialize coordinate sequences compactly.
Use it for:
- Compress GPS traces from mobile or IoT devices for efficient storage or API transmission.
- Encode route polylines in mapping or navigation applications to reduce payload size.
- Store 3D coordinate paths (with altitude or elevation) in a compact, URL-safe string format.
- Decode polyline strings received from external mapping services or APIs back into coordinate tuples.
- Serialize geographic boundaries or multi-point geometries with configurable precision trade-offs.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Encodes and decodes geographic coordinate sequences into a compressed string format using the Flexible Polyline algorithm, supporting 2D and 3D coordinates with configurable precision.
Yes, if you need polyline encoding/decoding. The package is stable, dependency-free, permissively licensed, and handles both 2D and 3D coordinates with flexible precision. Dormancy is not a concern for a mature, single-purpose codec. Verify Python version compatibility for your target runtime.
Install
flexpolyline on PyPI
pip
pip install flexpolylineuv
uv add flexpolylinepoetry
poetry add flexpolylineInstalling flexpolyline
Before you install
Low friction install with no runtime dependencies. Package is dormant (last release 2020-11-21, last commit 2024-09-24) but remains functional.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions—suitable for most projects including commercial ones.
Quickstart
pip install flexpolyline
import flexpolyline as fp
example = [(50.1022829, 8.6982122), (50.1020076, 8.6956695)]
encoded = fp.encode(example)
decoded = fp.decode(encoded)
Verify before relying
- Whether precision parameter values (0 to 15) are actually enforced or validated by the implementation.
- Performance characteristics when encoding or decoding very large coordinate sequences.
- Compatibility with modern Python versions beyond 3.7, given classifiers list only up to 3.7.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | dormant — 2,092 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 139,456/month — #11,299 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: flexpolyline-0.1.0-py3-none-any.whl
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
polylineEncodes and decodes geographic coordinate…
unclear · top 5,000 on PyPI
pypolylineEncodes and decodes Google Polyline format…
unclear · top 15,000 on PyPI
pygeohashEncodes latitude/longitude coordinates to…
permissive · top 5,000 on PyPI
geohash2Encodes latitude/longitude coordinates to…
agpl · top 5,000 on PyPI
pylzsspylzss decodes and encodes data compressed with…
copyleft · top 15,000 on PyPI
python-geohashpython-geohash encodes and decodes geographic…
unclear · top 15,000 on PyPI
reverse_geocoderReverse Geocoder converts latitude/longitude…
copyleft · top 15,000 on PyPI
lat-lon-parserParses latitude-longitude coordinate strings in…
permissive · top 15,000 on PyPI
pyGeoTileConverts between geographic coordinate systems…
permissive · top 15,000 on PyPI
timezonefinderLooks up the timezone for any WGS84 coordinate…
unclear · top 5,000 on PyPI