--- id: flexpolyline version: "0.1.0" license: MIT license_treatment: permissive maintenance: dormant --- # flexpolyline — Flexible Polyline encoding: a lossy compressed representation of a list of coordinate pairs or triples License: permissive · Maintenance: dormant · Downloads: 139.5K/mo ## 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 above — 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 pip install flexpolyline uv add flexpolyline 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: unspecified - Install friction: low - Maintenance: dormant - Downloads: 139.5K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags polyline encoding decoding, coordinate compression, flexible polyline format, geographic path encoding, lat lng compression, lossy coordinate encoding, polyline string format, geospatial, compression, encoding [View on SkillFed](https://skillfed.io/packages/flexpolyline) · [View on PyPI](https://pypi.org/project/flexpolyline/)