How to generate infrastructure from OSM
On geofabrik, download the
.osm.pbffile corresponding to the area you want. Here we take Germany as an example.This is not mandatory, but using osmium is strongly recommended to filter the
.osm.pbffile with only the railway-related data needed by osm_to_railjson. The tagrailwayis used on nodes, ways and relations, and the tagpublic_transport=stop_areais used on relations. This can divide by 3 the time taken by the osm_to_railjson generation.osmium tags-filter <path/to/germany.osm.pbf> nwr/railway r/public_transport=stop_area -o <path/to/germany.osm.pbf>Launch conversion (release build of editoast and conversion can be long):
cd ../../editoast cargo run --release -p osm_to_railjson -- <path/to/germany.osm.pbf> <path/to/germany_railjson.json>Depending on the area, signals data can be missing. If so, the
--generate-signalsoption overrides the potential existing signals with automatically generated realistics ones.Load the generated railjson, either using load-railjson-script.sh or OSRD’s web interface:
cargo run --release -- infra import-railjson --generate "Germany_OSM" <path/to/germany_railjson.json>