No routing on lines with multi modalities? (railway + highway flag)

I found a short line which has the flags railway=narrow_gauge and highway=primary at the same time, access flags are not set .
(Third method how to map tracks embedded in street

As you can see GraphHopper routes all the way around and avoids this line.

(Did not look into the code. I assume it is an early abort once the railway flag is found.)

We currently only accept a certain subsets of embedded railway tags like tram, but not narrow_gauge. As we want to really make sure ‘pure’ railways are not used for road routing. In this case one could easily separately map the two ways, IMO they are two ways :). Another way would be to add narrow_gauge although we reduce the strict behaviour a bit more then …

Thank you for your answer. After thinking about it for nearly two days I still think you are wrong with your approach.
Here my reasoning: A highway is open to traffic according its type/class and additional access modifier flags. An additional railway flag should not affect standard routing.

Nevertheless, the railway plus highway combination has some use in routing. For example if one would organize a cycle competition, or roller blade ride out, one would like to avoid such situations where the tracks are part of the pavement. Also reason why the 2010 Giro d’Itialia :bike: Etappe #20 ending on the Forcola di Livigno started in Poschiavo and not in Tirano.

I will look how easy it is to fix the bridge, to follow one of the other guidelines. It has the disadvantage to lose the meta information. But it seems to be the more common approach, and any other stretch on the Bernina line is uses allways two seperate ways.

A note for train enthusiast: A long stretch where the train runs on a street can be found in Michigan City, IN.

In theory you are right, but in practise there were some incorrectly tagged ways where we would then allow routing on rails (at least this was the case in the past). But maybe we should relax here more and trust the OSM community to find these tagging issues & fix those? Probably the more future proof solution. Feel free to open an issue at github for this, I’ll then link the older issues related to that

roller blade ride out, one would like to avoid such situations where the tracks are part of the pavement.

This is what we are doing for bike already: allow riding near trams, but put a bigger penalty on these roads.

A long stretch where the train runs on a street can be found in Michigan City, IN.

Do you have a link to this road and does GH allow routing on it?


Yes, routing is allowed. And the bike routing feature can be clearly seen :+1:

There is the principle that one should not map for the routing tool (or renderer). A little bit adapted: one should not route for the mapping fool. :wink: Just like you correctly do not route through a barrier with no access tags. Found a few of those, thanks to graphhopper.

As I now have also stumbled over the non-routing over fords (Discussion here: (My example here: it was time to adapt and write my own FlagEncoder.
It also allowed me to remove the conditional access restrictions.

I do not care about closed alpine :snowflake: passes. When summer comes they will be open :smile: :motorbike:

it was time to adapt and write my own FlagEncoder

If you explicitely tag as allowed for car etc then this will be already considered. But we are conservative here for the default settings. Furthermore you can just change the setting to allow passing fords regardless of the access tagging, no need here for an own FlagEncoder.

What do you mean here? We do currently not parse summer or winter as this depends on the country and so conditional access should include only the really important ones like closed roads for several days etc

An example is the Susten, Which has a Nov-May restriction.

Then there is the Pragel, partially closed Sa-Su.
Surprisingly, you route over it although it is Sunday today.

More challenging (TODO #374) is the Hongrin which is not only closed Nov-May, but also closed Mo-Fr.

As I want to have a route which includes Pragel (plus some other roads closed on Sa-Su) and Hongrin, I thought it was safer to switch it off.

In future, I would also disallow any ferry/car_shuttle save a few explicitly allowed, for ex. Lötschberg. For now I disallow all of them.

Finally, I wanted to use the motorcycle through the web API :grin: plus with the cherry on the top which is made of pure curiosity :smirk_cat: .

1 Like

This topic was automatically closed after 12 days. New replies are no longer allowed.