Registry / serialization / flexpolyline

flexpolyline

JSON →
library0.1.0pypypi✓ verified 86d ago

Flexible Polyline encoding, a lossy compressed representation of a list of coordinate pairs or triples, based on the HERE Flexible Polyline encoding standard. Current version: 0.1.0. Release cadence: sporadic, maintained by HERE Technologies.

pip install flexpolyline
INSTALL
IMPORT
SIG · FLEXPOLYLINE
F
flexpolyline
serializationpythonv0.1.0
Install
1.5s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

encode
from flexpolyline import encode
decode
from flexpolyline import decode

Basic usage: encode a list of coordinate tuples, decode back.

from flexpolyline import encode, decode # Coordinates as list of (lat, lon) pairs coordinates = [(52.5, 13.35), (52.515, 13.36), (52.520, 13.37)] # Encode with default precision (5) and 2D (third dimension none) encoded = encode(coordinates) print(encoded) # e.g., 'BF05xgKuy7lB8s7B' # Decode back to coordinates decoded = decode(encoded) print(decoded) # [(52.5, 13.35), (52.515, 13.36), (52.520, 13.37)]
Debug
Known issues
gotchaThe decode function returns a list of tuples, not a list of lists or numpy arrays.
fix
Access coordinates as tuple elements, e.g., lat, lon = decoded[0].
affects: all
gotchaCoordinates must be in (lat, lon) order, not (lon, lat).
fix
Ensure your input tuples are (latitude, longitude).
affects: all
gotchaThe library uses a specific precision (default 5) which may cause loss of detail for high-precision coordinates.
fix
For higher precision, pass the precision parameter to encode: encode(coords, precision=7).
affects: all
Errors
Common errors & fixes
ValueError: Unknown third dimension value: 3
The third_dim parameter must be 0 (none), 1 (elevation), or 2 (elevation and extrude).
fix
Use allowed values: third_dim=0, third_dim=1, or third_dim=2.
TypeError: a float is required
Coordinates contain non-numeric values or are not in the correct format.
fix
Ensure all coordinate values are floats and input is a list of tuples of numbers.
flexpolyline._flexpolyline.PolylineDecoderError: Invalid character in input
The encoded string contains invalid characters (e.g., spaces, special symbols).
fix
Pass only the valid encoded polyline string; remove whitespace or unexpected characters.
Upgrade
Version history
0.1.0latest on PyPI · released Nov 21, 2020
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
12
Resources
flexpolyline — pip install flexpolyline · libregistry