osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.63k stars 1.01k forks source link

Offline routing, fallback to unpaved roads if no other road is avaiable #3435

Open ghost opened 7 years ago

ghost commented 7 years ago

Hi there

I drive a lot on rural areas, I started using osmand recently, when using offline routing, plus with the options enabled to avoid unpaved roads and to use fuel saving route (shortest but not the fastest), a lot of times I find myself without a usable route to my destination, because my destination can't be reached without using dirt roads, osmand just draws a straight line to the destination, and yes these roads are clearly already on the map.

A workaround is to disable 'avoid unpaved roads', then it works, the problem then is that sometimes a better (paved) road is available for my destination, but it's much longer, then osmand redirects me to unpaved roads because the are much shorter.

Another workaround to this last situation is to enable 'faster route', but then I found myself driving great lengths, because osmand tries to use better road types first.

Can something be done about this?

Latest version from F-Droid, 2.5.4

Thanks for your time.

sonora commented 7 years ago

I see 2 possible solutions:

Solution 1 would be we allow unpaved roads as a last resort, even if the user explicitly selected "Avoid unpaved roads". It is debatable if this makes sense, because it contradicts the meaning off "avoid unpaved roads", e.g. a user simply trying to find out if a destination can be reached strictly via paved roads would be fooled into a false positive.

Solution 2: If your experience is that with our standard settings "Avoid unpaved roads=OFF" and "Fastest route=ON" you say that longer, paved roads are favored too much over shorter, unpaved roads, it seems to indicate the we have a little too much penalty on unpaved roads. The solution would be to slightly lower that penalty a little in our routing file.

But this may depend on local preference, region, and with that also the quality of the unpaved roads (in some areas people may curse us for routing over nearly impassable unpaved 4WD roads if a paved road is available, even if it is much longer). From personal experience I know it also depends on weather, climate, etc. Solution 2 will also require significant testing.

ghost commented 7 years ago

From that, I think solution 1 would be the appropriate.

To avoid users being fooled into false positives, it could be an option right next to 'prefer faster routes', (Unpaved as last resort (yes/no)), where we could allow the use of unpaved roads as last resort, that way users could control the fallback to dirt roads.

So, if user have a capable vehicle and doesn't mind dirt roads, would set this to "yes", if not, just leave it "no" (should be the default).

This would differ from 'Avoid unpaved roads' option, because it would only allow unpaved roads if no better road available to reach destination.

I think this would also resolve the problem of people not wanting unpaved roads at all.

I personally don't mind unpaved roads, if there's no other way to get to the destination.

sonora commented 7 years ago

So I guess the solution could be we have

May be a viable solution, not sure. Issue is it's mutually exclusive, so we either have to add additional logic, or make one supersede the other if user selects both.

ghost commented 7 years ago

From end-user point of view, I think would be better to have this rather than not. The challenge here is making it 'clean' as possible to not mess all the routing code.


I been talking about a similar problem with a colleague. He told me that the offline routing engine with the 'avoid unpaved roads' enabled can add many troubles when driving to some places.

He described something like this:

osmand sent him to point B, the closest point to "A", then he leaves the car and tries to go on foot, but couldn't, because terrain is very difficult, couldn't even find a path to walk. He drives to point C, leaves car and follows dirt road on foot, making it possible to reach point A. He used the dirt road as a path to destination.

This isn't the same problem, but somehow similar, and makes you think that the use of "avoid unpaved roads' can somehow have the opposite effect that you would want.

sonora commented 7 years ago

I would say that's expected behavoir:"Avoid unpaved" gets you as close as possible on paved. It may or may not be better if the remaining trip is 1km cross country, or 4km on a dirt track, the app cannot generally know.

But I guess that also this case can be solved by offering the user a choice to "avoid unpaved where possible". @vshcherb What do you think?

sonora commented 7 years ago

PS: I just notice that our implementation of "Avoid unpaved" in bicycle routing behaves like "Avoid unpaved as much as possible", so you could play with that for testing.

ghost commented 7 years ago

But I guess that also this case can be solved by offering the user a choice to "avoid unpaved where possible".

Exactly my opinion.

I'm gonna check the bicycle routing... Thanks.

Update: I confirm that the "Avoid unpaved" in bicycle routing avoids unpaved roads as much as possible, but uses them if no other alternative.

naoliv commented 7 years ago

From this old feature request https://code.google.com/archive/p/osmand/issues/2026 I had suggested something like this:

and the answer was It will be supported only with new routing.xml where we could have more than 2 values of switch.

Is it still not possible to implement this?

We could even have a Prefer option (making it 4 options in total: Never, Avoid if possible, Default and Prefer)

ghost commented 7 years ago

I support the idea, it would fix the problem with 'unpaved roads' mentioned above, and similar routing problems related to other road types.

As it is now, 'avoid' roads equals to 'never use', causing routing problems if there's no other road type available to reach destination.

Not sure if it is too complex to implement...

aceman444 commented 7 years ago

I don't think OsmAnd should automatically choose unpaved roads if the user didn't allow them. It can do it only if it tells/indicates to the user that it had to choose such roads. The infrastructure for such indications would need to be implemented.

ghost commented 7 years ago

Hi, I'm still having this problem and I find myself on the wrong roads many times because of this. I would like to know if there's anything planned to fix this in the (near) future?

I know for a fact that I'm not the only one with this problem.

Yesterday I was speaking with a mate facing the same problem, this mostly depends where you drive and I admit most people doesn't need this feature, but when driving on rural areas I face this problem almost every day, until I ignore gps and navigate myself through known roads.

From this old feature request https://code.google.com/archive/p/osmand/issues/2026 I had suggested something like this: and the answer was It will be supported only with new routing.xml where we could have more than 2 values of switch. Is it still not possible to implement this? We could even have a Prefer option (making it 4 options in total: Never, Avoid if possible, Default and Prefer)

"Avoid if possible" would be it, so we would not end with an unusable route when there's no other alternative (other than unpaved roads, ferries, etc) to reach destination.

hakuchi commented 7 years ago

The solution with "avoid if possible" sounds good for me.

Some days ago, I had a similar problem with a parking way(service=paking_aisle) with the underground tagged as gravel. On parking ways and also unclassified/service/residential with underground=gravel/unpaved/ground/etc. the access is allowed for motor vehicles, but if I set "avoid unpaved roads", these roads will not be used for routing.

@Tony-il-Capo what is the tagging on OSM for the final road to your destination? track or service/residential with unpaved underground?

ghost commented 7 years ago

@hakuchi From top of my head mostly unpaved residential roads (primary dirt roads, no other alternative), some unclassified as well. Obviously, as I said before, for this situation you may disable 'avoid unpaved roads', but then, when there's actually multiple road types available, osmand will probably select the unpaved road if it is much shorter.

The point is, we don't mind unpaved roads IF there's no other alternative.

You made me remember that in some of my tests, I also don't see much difference on how osmand chooses between multiple unpaved roads types - like residential, unmaintained, etc Obviously, residential ones will probably be in much better condition than unmaintained... but that's another matter.

jfburke3 commented 5 years ago

In support of this, here is a church that you cannot reach without driving on unpaved roads: https://www.openstreetmap.org/way/414743384

griebd commented 5 years ago

I live in a farm, every time I need to use osmand to get somewhere from home I have this annoyance! If I enable unpaved roads I sometimes get routes through unpaved roads that I don't want, if I disable I need to wait until I get to the main paved road to enable osmand or I keep getting this annoying "recalculating route"....

The proposed solution looks good to me, BUT:

I think "avoid unpaved roads" shouldn't be taken as "forbid unpaved roads"... they should be used as a last resource, all other gps system I have used works like that...

pebogufi commented 5 years ago

If you want to hava a "hard" blocking of a road try to use option "avoid road".