Skip to content

openlr-decoder

Fast OpenLR location reference decoder for Python.

PyPI Python License CI

Decode HERE-encoded OpenLR location references onto OSM-based road networks. Built in Rust with Python bindings via PyO3 for high performance.

Features

  • Fast: Rust core with parallel batch decoding via Rayon
  • Zero-copy data loading: Pass Arrow tables, Polars DataFrames, or PyArrow RecordBatches directly — no serialization overhead
  • Cross-provider: Tuned for decoding HERE-encoded OpenLR onto OSM road networks
  • Configurable: 14 parameters for scoring weights, tolerances, and search behavior
  • Batch-friendly: decode_batch() returns an Arrow RecordBatch for seamless integration with Polars, Pandas, and DuckDB

Quick Start

pip install openlr-decoder
from openlr_decoder import RoadNetwork, Decoder

network = RoadNetwork.from_parquet("network.parquet")
decoder = Decoder(network)

result = decoder.decode("CwRbWyNG9RpsCQCb/jsboAD/6/+E")
print(result.edge_ids)    # [12345, 12346, 12347]
print(result.length)       # 542.3

Next Steps