skillfed

flexpolyline

Flexible Polyline encoding: a lossy compressed representation of a list of coordinate pairs or triples

flexpolyline v0.1.0 139.5K downloads/30d#11,299 on PyPI116
Permissive license MIT DORMANT released

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 flexpolyline

uv

uv add flexpolyline

poetry

poetry add flexpolyline

Installing 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

Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 2.7Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7

Tags

polyline encoding decodingcoordinate compressionflexible polyline formatgeographic path encodinglat lng compressionlossy coordinate encodingpolyline string format
geospatialcompressionencoding

More Scientific/Engineering packages