An open API service indexing awesome lists of open source software.

https://github.com/anyways-open/itinero-io-osm-transit

A preprocessor for Itinero adding OSM-based public transport routing to a routerdb.
https://github.com/anyways-open/itinero-io-osm-transit

itinero openstreetmap public-transport routing

Last synced: 4 months ago
JSON representation

A preprocessor for Itinero adding OSM-based public transport routing to a routerdb.

Awesome Lists containing this project

README

        

# itinero-io-osm-transit

A preprocessor for Itinero adding OSM-based public transport routing to a routerdb.

```
// load routerdb.
var routerDb = RouterDb.Deserialize(
File.OpenRead(@"/data/work/data/OSM/belgium.routerdb"));

// extract profiles.
var pedestrian = routerDb.GetSupportedProfile("pedestrian");
var bicycle = routerDb.GetSupportedProfile("bicycle");
var car = routerDb.GetSupportedProfile("car");

// load transit data formatted as osm data.
using var source = File.OpenRead(@"/data/work/data/pt-osm/transit.osm");
var osmSource = new OsmSharp.Streams.XmlOsmStreamSource(source);

// add pt links to routerdb.
routerDb.AddPublicTransport(osmSource, new IProfileInstance[] { pedestrian, bicycle, car });

// compress the routerdb.
routerDb.Compress();

```