This repo contains a profile for routing (mostly freight) trains with OSRM. This enables you to find the shortest path by train between 2 points and also do map matching with OSRM.
Note: travel time estimations are way too optimistic due to the red lights, stations and traffic not taken into account
Right now, it contains, 2 profiles :
basic.lua
A basic/naive profile that works quite well.
freight.lua
A profile optimized for freight trains:
Possible improvements that we might one day include :
Inspiration for the code taken from an old russian blog and the car profile
First, you will need to install the Docker daemon and osmium (osmium-tool
on Ubuntu) on your machine.
Then, run make all
to download the OSM data, filter and combine it and finally compute the routing graph.
Last, run make serve
to serve the OSRM server locally on port 5000
This code is under the 2-Clause BSD License.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.