{"id":21354,"library":"flexpolyline","title":"FlexPolyline","description":"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.","status":"active","version":"0.1.0","language":"python","source_language":"en","source_url":"https://github.com/heremaps/flexible-polyline","tags":["polyline","encoding","compression","geospatial","HERE"],"install":[{"cmd":"pip install flexpolyline","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"","wrong":"","symbol":"encode","correct":"from flexpolyline import encode"},{"note":"","wrong":"","symbol":"decode","correct":"from flexpolyline import decode"}],"quickstart":{"code":"from flexpolyline import encode, decode\n\n# Coordinates as list of (lat, lon) pairs\ncoordinates = [(52.5, 13.35), (52.515, 13.36), (52.520, 13.37)]\n# Encode with default precision (5) and 2D (third dimension none)\nencoded = encode(coordinates)\nprint(encoded)  # e.g., 'BF05xgKuy7lB8s7B'\n\n# Decode back to coordinates\ndecoded = decode(encoded)\nprint(decoded)  # [(52.5, 13.35), (52.515, 13.36), (52.520, 13.37)]","lang":"python","description":"Basic usage: encode a list of coordinate tuples, decode back."},"warnings":[{"fix":"Access coordinates as tuple elements, e.g., lat, lon = decoded[0].","message":"The decode function returns a list of tuples, not a list of lists or numpy arrays.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure your input tuples are (latitude, longitude).","message":"Coordinates must be in (lat, lon) order, not (lon, lat).","severity":"gotcha","affected_versions":"all"},{"fix":"For higher precision, pass the precision parameter to encode: encode(coords, precision=7).","message":"The library uses a specific precision (default 5) which may cause loss of detail for high-precision coordinates.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use allowed values: third_dim=0, third_dim=1, or third_dim=2.","cause":"The third_dim parameter must be 0 (none), 1 (elevation), or 2 (elevation and extrude).","error":"ValueError: Unknown third dimension value: 3"},{"fix":"Ensure all coordinate values are floats and input is a list of tuples of numbers.","cause":"Coordinates contain non-numeric values or are not in the correct format.","error":"TypeError: a float is required"},{"fix":"Pass only the valid encoded polyline string; remove whitespace or unexpected characters.","cause":"The encoded string contains invalid characters (e.g., spaces, special symbols).","error":"flexpolyline._flexpolyline.PolylineDecoderError: Invalid character in input"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}