Closed juliusfriedman closed 4 years ago
I have confirmed that a transformed osm.pfb file will route without a modification required for the profile for now.
The key was dropping the highway and then converting the rail to highway and saving a new osm.obf file.
Thanks for your assistance.
Hello All,
I have prepared a railroad exact from the planet dump found at https://planet.openstreetmap.org/
I believe I have extracted all features except the rail layer using the following command
The resulting
planet-rail.osm.pbf
is about 350 MB and can be read by Itinero using the code from the documentation. HereWhere we supplied the
planet-rail.osm.pbf
as the input.I tried the following calls to get the broadest range of paths made available:
routerDb.LoadOsmData(stream, Itinero.Osm.Vehicles.Vehicle.Car, Itinero.Osm.Vehicles.Vehicle.Bicycle, Itinero.Osm.Vehicles.Vehicle.Moped, Itinero.Osm.Vehicles.Vehicle.MotorCycle);
I can then get a RouterPoints but I need to specify a large searchDistance as can be seen here:
However I can never calculate a route as I get RouteNotFoundException from the following call:
var route = router.Calculate(Osm.Vehicles.Vehicle.Car.Fastest(), routerPointStart, routerPointEnd);
I think what is happening based on a few discussions is that Itinero is throwing away the track and rail segments based on the vehicle profiles I have provided. Is that a correct assumption?
It seems I need to provide a Vehicle implementation for Train, is that also a correct assumption?
But I am not sure how as there is no example for C#.
I imagine I would also be able to create a LUA file which is specific for trains but again I would need some guidance, based on https://github.com/itinero/routing/issues/273 it seems like a relatively small change to get the profile to accept track and rail and not other types such as highway however I am then not sure if the routing engine itself will still work.
If it will can you provide an example of a LUA file/profile which is able to route along the track I should be able to get it to work with the RouterDb As seen here it seems.
Please let me know if what I am trying to achieve is possible with Itinero and if not if you have any suggested alternatives such as the itinero transit project.
Thank you!