Skip to content

Polyline decoder

Pure-Python decoder for Valhalla's polyline6-encoded geometries. See Decoding shape for the encoding details and reference implementations in other languages.

decode_polyline

decode_polyline(polyline: str, precision: int = 6, order: str = 'lnglat') -> List[Tuple[float, float]]

Decodes an encoded polyline string with precision to a list of coordinate tuples. The coordinate order of the output can be lnglat or latlng.