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
4.85k stars 1.54k forks source link

Make ford check including checking depth == 0 #236

Closed karussell closed 4 years ago

karussell commented 10 years ago

As the wiki says a ford can have depth=0 so we should include this in our check for all vehicles. Additionally we could use InstructionAnnotation to warn the user about this possible problem. What about intermittent=yes or seasonal=yes?

Which will fix e.g. this possible bus route: bus-route

http://graphhopper.com/maps/?point=Kulgera%2C%20Australia&point=Alice%20Springs%2C%20Australia

rome2rio commented 10 years ago

Looking at the OSM data for Australia, depth=0 is very rarely used (only a couple of nodes/ways).

Would it be better to treat fords as passable on major roads? If highway==motroway|trunk|primary it's probably safe to assume the road is passable by any vehicles likely to be in the area (Stuart Highway, in the example above, is a trunk). And even if it's not the best rd, it's probably better than any other nearby rd.

This would fix all the broken Ford routes I've seen. Making fords passable on Secondary & Tertiary roads may also be worthwhile?

I've only looked in Australia through, so the usage may differ in other parts of the world.

karussell commented 10 years ago

Hmmh, I would like to avoid this if we are not sure. Because if there is a different tagging philosophy in another country then we guide people over fords which is really ugly if not empty.

If overpass API would be easier to use we could probably find this out fast. But I failed the last minutes to get what we want :/ (similar to this?). Maybe you can find out the query and I'll check for Germany and parts of the US?

MarkCupitt commented 10 years ago

Don't forget Seasonal issues, some roads are passable in the Dry Season, but not passable in the Wet Season. I'm not sure how they are tagged or if it is possible but it sure would be nice to accommodate that

Regards

Mark Cupitt

rodneyodonnell commented 10 years ago

(switching back to my regular account, I was logged in as rome2rio on my previous comment).

I haven't played with the overpass API before but hacked something together which seems to work.

This quesy displays all major roads with a ford on them (and all the other fords too as I couldn't work out how to get rid of them...). It would be great if someone could do a quick sanity check of the code as I'm not 100% sure I'm doing it right.

(
  (
    node({{bbox}})[ford~"^(yes)$"];
    way(around:0)[highway~"^(motorway|trunk|primary)$"]
  );>;
)
;out;

Doing some spot checks, I see that there is no obvious impact from fords (on major roads) in the US, Canada, Germany, the UK, Norway or Ireland. However, there are quite a few of them throughout Africa, South America and outback Australia.

To me, it seems that all these roads in Australia should be treated as passable. The fords will be dry the vast majority of the time and if you're driving in that part of the country you would usually be in a 4wd anyway.

Many of these roads in South America are unpaved and in remote regions so the same logic would probably apply. Not sure how any of these are dry year-round through.

Matt: I don't have a good feel for how many of these cases are impacted by wet/dry season. Looking at the Pantanal in Brazil (80% submerged floodplains during wet season according to wikipedia) there are a bunch of fords, but not on major roads. Seems that most primary/trunk roads would be driveable year round?

karussell commented 10 years ago

Ok, thanks - I'll check! BTW: where did you find this notation?

Regarding time: well that problem we also have for ferries and in theory we could decrease time depending on how often the ferry goes (currently we just take the duration into account).

For fords I don't see a big problem as Rod pointed out that is mostly dry in Australia and OpenStreetMap has not really a notation to indicate the time it only says 'seasonal=yes' if I'm not wrong.

I also found this in the wiki: "ford=* unlike flood_prone areas, fords may be safe to cross if there is water across the roadway." See http://wiki.openstreetmap.org/wiki/Key:flood_prone ... hmmh but this is also seasonal: http://wiki.openstreetmap.org/wiki/Talk:Key:bridge "two years ago two young men died trying to pass it"

rodneyodonnell commented 10 years ago

I based my code on the accepted answer in the stackoverflow you linked to: http://stackoverflow.com/q/22468442/194609

Spent a bunch of time trying/failing to get the XML working first though :-)

karussell commented 9 years ago

Probably we tag this route segment as potential dangerous (via instruction annotation). I got a new report in france that this should be passable.

malenki commented 9 years ago

I'd vote for make fords routable with graphhopper. If the weren't passable the one or other way they wouldn't have been mapped as ford. You may warn users for fords (not the way between them), but there are less developed countries where routing with graphhopper will get you nowhere if you won't router over fords: https://graphhopper.com/maps/?point=benje-novosele&point=40.299871%2C20.467808

PS: In case you want to send the bicycle along the path (routing is fine this way) have a look at it. (scai, thanks for the hint)

MarkCupitt commented 9 years ago

Suggestion: Maybe in the Turn Instructions, list specifically that it is a Ford and may not be passable ..

scaidermern commented 9 years ago

Maybe we should try to give fords just a penalty instead of avoiding them altogether.

pyrog commented 9 years ago

@malenki :+1:

I'd vote for make fords routable with graphhopper. If the weren't passable the one or other way they wouldn't have been mapped as ford. You may warn users for fords

@scaidermern :+1:

Maybe we should try to give fords just a penalty instead of avoiding them altogether.

See an example in France: I use intermediates to force the algorithm to use this itinerary.

We could have the same problem with mountain pass in winter :wink: :bulb: Add an option to avoid mountain pass, ford, toll…

engaric commented 9 years ago

You may want to look at some of the code I have done in engaric / graphhopper specifically the avoidance decorator hierarchy. Unfortunately I haven't managed to clear the contributor license with program management yet so cannot yet contribute it to upstream.

Sent from my BlackBerry 10 smartphone on the EE network. From: pyrog Sent: Friday, 12 June 2015 20:53 To: graphhopper/graphhopper Reply To: graphhopper/graphhopper Subject: Re: [graphhopper] Make ford check including checking depth == 0 (#236)

@malenki :+1:

I'd vote for make fords routable with graphhopper. If the weren't passable the one or other way they wouldn't have been mapped as ford. You may warn users for fords

@scaidermern :+1:

Maybe we should try to give fords just a penalty instead of avoiding them altogether.

See an example in France: I use intermediates to force the algorithm to use this itinerary.

We could have the same problem with mountain pass in winter :wink: :bulb: Add an option to avoid mountain pass, ford, toll…


Reply to this email directly or view it on GitHub: https://github.com/graphhopper/graphhopper/issues/236#issuecomment-111598751

malenki commented 9 years ago

engaric schrieb am Fri, 12 Jun 2015 13:22:17 -0700:

We could have the same problem with mountain pass in winter :wink: :bulb: Add an option to avoid mountain pass, ford, toll…

I wouldn't simply avoid mountain passes but only roads not cleared or even closed in winter. gritting= and winter_service= do exist, though I don't if roads closed in winter get mapped differently.

Now you just need to define "winter".

pyrog commented 9 years ago

@malenki

I wouldn't simply avoid mountain passes but only roads not cleared or even closed in winter.

You're right :smile: I see your proposed feature winter_service.

Now you just need to define "winter".

We could compute it with the date and our position on the earth, but we could simply use conditional restrictions. (See #374) Another solution is to use TMC datas ?

pyrog commented 8 years ago

depth=* is never used in France.

Also the value ford=stepping_stones is used (814 in TagInfo) Cars and horses can't use theses fords :wink: Only foot and maybe bicycles ?

As @malenki, @scaidermern and @MarkCupitt, I'd vote for make fords routable with graphhopper. @karussell Could you do this please?

PS: I added a nice picture of stepping stones in the wiki.

karussell commented 8 years ago

Ok, this is important but without route instructions warnings not good/safe IMO. Postponing for now

pyrog commented 8 years ago

 Postponing for now

IMHO this issue should be fixed now, and a safety tips should be displayed like : "Hiking [...] contains inherent risks which no amount of care, caution or expertise can eliminate. This site is no substitute for topo maps, route finding skill, compass, physical condition, sense of humor or good judgement"

Source: http://www.toddshikingguide.com/Warning/Warning.htm

karussell commented 8 years ago

Currently, does GH can display route instructions warnings ?

We can add annotations to instructions, which should be marked as warning then.

IMHO this issue should be fixed now, and a safety tips should be displayed like :

postponing only for the upcoming release

Hiking [...] contains inherent risks which no amount of care, caution or expertise can eliminate.

Sure, for example we have this in our terms. But as this is not really a big effort and of great help we should include it before enabling this for all.

Also if you really need this you can already enable routing through fords.

zstadler commented 8 years ago

I also think routing through fords should be the default. As said above, the routing program is not responsible for weather conditions.

Given that fords are used in many different places in the world, any assumptions on access implications will be incorrect in a different climate or culture.

IMO, any routing implications or restrictions should be tagged separately using access, width, weight, and similar tags.

karussell commented 7 years ago

I was pointed to https://wiki.openstreetmap.org/wiki/Key:flood_prone which says unlike flood prone areas, fords may be safe to cross if there is water across the roadway. So can/should we just assume fords are safe? And block/warn only flood_prone? Or is this dependent on the mapper/geographic region?

Hmmh, okay blocking of flood_prone would be also suboptimal: Flood prone areas don't have water across them 99.9% of the time

boldtrn commented 7 years ago

Are there any news on this issue? Is this still something we want to do?

A way I see to fix this would be to:

So probably it would make sense to make this change in the DataflagEncoder. Could be also added to other Encoders, but not sure if this would take about to much storage in the graph?

pyrog commented 7 years ago

A way I see to fix this would be to:

  • Allow routing through fords, [optionally] add a penalty?
  • When routing over a ford, create an InstructionAnnotation that notifies about crossing a ford
  • Show the annotation in the web interface?

👍

karussell commented 7 years ago

Are there any news on this issue?

no

Is this still something we want to do?

yes, sure :)

So probably it would make sense to make this change in the DataflagEncoder. Could be also added to other Encoders, but not sure if this would take about to much storage in the graph?

Yes, maybe for now DataFlagEncoder and then the storage requirement is less than one bit :)

karussell commented 7 years ago

A note regarding a ford can now be given in the instructions, still for the DataFlagEncoder only.

To make this less of an issue what about the following:

See also the discussion on the OSM forum

bohwaz commented 7 years ago

Seems that the fords are still regarded as unpassable.

eg. https://graphhopper.com/maps/?point=-39.233217%2C175.509124&point=-39.233284%2C175.510883&locale=en-NZ&vehicle=foot&weighting=fastest&elevation=true&use_miles=false&layer=Omniscale

Graphhopper doesn't want to cross the river, as a result the route is not making any sense.

Here in NZ it is very common to have to cross rivers on a hiking track, you can't really avoid them.

mprins commented 7 years ago

@bohwaz it does when you use the "hike" profile: https://graphhopper.com/maps/?point=-39.233217%2C175.509124&point=-39.233284%2C175.510883&locale=en-NZ&vehicle=hike&weighting=fastest&elevation=true&use_miles=false&layer=Omniscale

bohwaz commented 7 years ago

Ah great! Though I don't understand how you made all those new buttons appear ^^

mprins commented 7 years ago

@bohwaz there's a button like "..." next to the bike

bohwaz commented 7 years ago

Oh my! Thanks! Didn't look like a button though.

Sorry then, thanks for your help :)

IknowJoseph commented 6 years ago

Fords are now routable? For instance: http://www.openstreetmap.org/directions?engine=graphhopper_car&route=-1.2329%2C37.4654%3B-1.2346%2C37.4666#map=17/-1.23424/37.46722

scaidermern commented 6 years ago

Fords are now routable? For instance: http://www.openstreetmap.org/directions?engine=graphhopper_car&route=-1.2329%2C37.4654%3B-1.2346%2C37.4666#map=17/-1.23424/37.46722

This is a way tagged as ford=yes. I guess this gets handled differently or not at all.

IknowJoseph commented 6 years ago

Good spot, yes :)

Also applies to nodes tagged as ford=yes:

http://www.openstreetmap.org/directions?engine=graphhopper_car&route=1.19272%2C35.74388%3B1.18673%2C35.74231#map=17/1.18975/35.74259 http://www.openstreetmap.org/node/4401108509

On 16 December 2017 at 14:48, Alexander Heinlein notifications@github.com wrote:

Fords are now routable? For instance: http://www.openstreetmap.org/ directions?engine=graphhopper_car&route=-1.2329%2C37.4654% 3B-1.2346%2C37.4666#map=17/-1.23424/37.46722

This is a way https://www.openstreetmap.org/way/546604754 tagged as ford=yes. I guess this gets handled differently or not at all.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/graphhopper/graphhopper/issues/236#issuecomment-352187949, or mute the thread https://github.com/notifications/unsubscribe-auth/ABzxsj801_XOr19nI36UOgykF-Krvituks5tA9g5gaJpZM4CMuId .

karussell commented 6 years ago

Yes, we now use the block_fords=false option in the Directions API that was already there in the routing engine and we will see if this results in better feedback or worse as the current state gave us too many reports (similar to our still conservative behaviour for ferries and gates)

karussell commented 4 years ago

There is now a prominent warning for all vehicles due to #1811, so we've finally made block_fords=false the default for all FlagEncoders.

Additionally there is a bug fix to still block fords if explicitly tagged.