graphhopper / graphhopper

Open source routing engine for OpenStreetMap. Use it as Java library or standalone web server.
https://www.graphhopper.com/open-source/
Apache License 2.0
5.05k stars 1.57k forks source link

railway=funicular (without highway=*) not considered for routing #1263

Open grischard opened 6 years ago

grischard commented 6 years ago

Routing by foot does not consider funiculars.

None of the existing routing services is able to route across funiculars like this one . Both bicycle and foot should be possible. This particular free funicular runs every minute, and is a lot quicker than walking up the hill by foot.

It would be great if it could be used for routing the way water ferries are.

boldtrn commented 6 years ago

Are you referring to regular foot routing or public transport routing?

For regular foot routing I think this is a bit difficult. You have to include ferries into foot routing, because otherwise some islands are not reachable or massive detours would be taken. With funiculars I am not so sure if it makes sense. Also the times when the funicular is not running (in this case only from 0:30 to 4:45), we should not route along it, which is currently not possible with regular foot routing. In this case, since it runs every minute and is free, I would assume it is heavily used by the locals.

BTW: This is also related #344, which is about routing of gondolas. The consensus in #344 was that it makes sense to include these into foot/bike routing adding a penalty to it, so I think the same would apply here. Do you want to create a PR for this?

grischard commented 6 years ago

Hello. Yes, it would be regular foot and bicycle routing. Yes, locals use it like you'd use a pavement or a lift. They also use graphhopper heavily on the country's official travel planner (see foot at the bottom, then map).

343 is also related, I think.

Would this be a lot to chew on for a first PR? It can't be as simple as copy-pasting the ferry code and adding a few test cases, can it?

boldtrn commented 6 years ago

Would this be a lot to chew on for a first PR?

I expect it to be straightforward :).

It can't be as simple as copy-pasting the ferry code and adding a few test cases, can it?

Yes, for Foot this would mean something like this (in this case I also added the pessenger tag and removed the ferry bit - if you compare it to the original ferry code in the FootFlagEncoder):

            if (way.hasTag("railway", funicular)) {
                String footTag = way.getTag("foot");
                if ((footTag == null || "yes".equals(footTag)) && !was.hasTag("passenger" "no"))
                    acceptPotentially = acceptBit ;
            }

I am not yet sure how we would handle the speed of funiculars. In general we don't want them to "look" fast in the graph, since probably most require some waiting and it should be easy to avoid them by adding an additional waypoint. If we apply a speed of 15 or so km/h this would make it very likely that any funicular is used, even though walking would be shorter (and maybe even faster). I think, we should avoid them if easily possible and only use them if the alternative would mean a bigger detour.

So maybe we should apply slow_speed to them in handleWayTags? This probably requires some testing with a couple of different connections and see if GraphHopper only takes them if it seems reasonable.

For example for this route, I would expect the funicular to be used. But probably not for this route?

Please let me know if you have any further questions :).