Skip to content


Switch branches/tags

OpenLR for .NET

Build status Visit our website GPL licensed

  • OpenLR: NuGet Badge
  • OpenLR.Geo: NuGet Badge

This is an implementation of the OpenLR (Open Location Reference) protocol using Itinero. Development was initially sponsered by ( and Be-Mobile (


  • Itinero: For a basic routing graph structure, loading data and routing.


The basics

By default, just like in Itinero, all code is there to decode/encode based on an OpenStreetMap network.

The most basic code sample encoding/decoding a line location:

    // build routerdb from raw OSM data.
    // check this for more info on RouterDb's:
    var routerDb = new RouterDb();
    using (var sourceStream = File.OpenRead(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "luxembourg-latest.osm.pbf")))
        routerDb.LoadOsmData(sourceStream, Vehicle.Car);

    // create coder.
    var coder = new Coder(routerDb, new OsmCoderProfile());

    // build a line location from a shortest path.
    var line = coder.BuildLine(new Itinero.LocalGeo.Coordinate(49.67218282319583f, 6.142280101776122f),
        new Itinero.LocalGeo.Coordinate(49.67776489459803f, 6.1342549324035645f));

    // encode this location.
    var encoded = coder.Encode(line);

    // decode this location.
    var decodedLine = coder.Decode(encoded) as ReferencedLine;

Samples & Docs

Check the samples here:

There is also basic documentation here: