Yes, can’t you just setup a custom profile that can only travel on railways?
Presuming GPS coordinates are within a reasonable distance from railway tracks
Hiya, I haven’t attempted to allow only train paths but as you aren’t requiring time, you could setup a custom profile, use any base vehicle and remove all standard road access within the profile. Then assign only rail type networks.
I would imagine something like setting up a custom profile based on car that can only drive on footpaths.
There is most likely something I’m overlooking but if I was doing it, I would attempt to just get the most basic route working first.
One major hurdle might be that railways are rather sparse compared to roads. So if you enter GPS coordinates that aren’t close to any railways you might run into ‘point not found’ errors.
Thanks for the help. I will note this as a possible solution.
In the meantime, I have launched the geofabrik/OpenRailRouting as it does seem to stick to rail using GPS, however even for Berlin OSM file I have found that the rails are not well mapped - in the following screenshot I have placed the endpoint farther and the map matching seems to not work anymore (see below). I was using the berlin OSM file, found here: Geofabrik Download Server
The railway seems to be mapped, otherwise it wouldn’t be shown on the map? What if you move the green marker further south? I wonder if this part of the railway cannot be found at all or if it is just not connected to the part North of the junction. You can also open the map layer menu and enable ‘Local MVT’ to see whether or not an edge was added to the routing graph for this railway.
It seems like it stops routing at the intersection to that road. Additionally, I noticed that more rails are not being map-matched - which might be related, is my guess. Obviously I don’t know much about these tools, so don’t take my guess as indicative. The issue is this - I add the start / end dots and the closest map-matched track is not the one that is closest to the points. Could this be related to profile settings I’m using (see first screenshot)?
Also, adding the screenshot for what happens when the green marker is moved south - it does not register it (second screenshot).
IMO questions regarding OpenRailRouting should go to their channels or towards @Nakaner_Geofabrik. We don’t know how they implemented it in details and also they still use a pre 1.0 GraphHopper version. You could also try what @easbar proposed as it uses the most recent GraphHopper including MVT view etc.
No worries, I understand that this is a bit of an offtopic for this forum - unfortunately openrailrouting team are not responsive in github issues, so I chose the path or
least resistance in the communication (this forum). Besides going to their github and/or tagging @Nakaner_Geofabrik do you perhaps know of other means of getting in touch with them?
Also, seems like I have solved the 2 issues I faced. 1. Issue with routing in the baltic region (Lithuania, Latvia, Estonia) is solved by creating a new profile (I provided the config file I use: Too many total edges were removed error problem · Issue #1 · geofabrik/OpenRailRouting · GitHub). The 2nd issue with the inability to properly calculate the distance on some berlin rails was solved by just using the entire German OSM file. There is an issue with the inability to add end/start endpoints at the edges of the maps, presumably an issue with OSM.
Yes this can be an issue. OSM ways often cover large distances (and maybe railway especially(?)). Depending on how the extracts are created some ways that are not located within the boundaries of the extract entirely might be not included at all (you can easily find out by opening your OSM file in JOSM or similar)
No. Right now I think the easiest way to do this is modify the CarTagParser in current master, or the corresponding CarFlagEncoder in 5.0, according to your needs. Another option would be using the RoadsTagParser/FlagEncoder and setup your own routing rules in a custom model.