OK, the code is actually pretty readable, I did my homework. It turns out the 
algorithm turns down tracks with tracktype=grade > 1. From 
CarFlagEncoder.acceptWay:

if (tt != null && !tt.equals("grade1"))
                return 0;

by changing this to 

if (tt != null && !tt.equals("grade1") && !tt.equals("grade2"))
                return 0;

I get correct results, and given the very low weight given to such tracks, it 
shouldn’t impact much other routings. Or would it ?

According to http://wiki.openstreetmap.org/wiki/Key:tracktype, grade2 should 
definitely be acceptable for a general purpose vehicle, grade3 probably too. As 
for the example outlined below (no man’s land between Mauritania and Morocco), 
it’s actually more like a grade4, mostly compacted sand, some soft sand. Still 
crossed by all kind of small cars every day. So if somebody corrects OSM with 
the more correct grade type, the routing will again fail. But this is 
unavoidable in the grand scheme of things.

Any thought ? submit a patch ?

Laurent

PS: note that in Australia, some tracks are labeled highway=secondary or even 
highway=primary, so the problem doesn’t exist.

On 5 janv. 2015, at 19:34, Laurent Bendel <[email protected]> wrote:

> Hi there,
> I’m new to graph hopper, but I’ve already spotted a problem: it seems the 
> algorithm decides that tracks (highway=track) are impassable by cars, but OK 
> for bikes. E.g.:
> 
> https://graphhopper.com/maps/?point=Dakhla%20الداخلة%2C%20Morocco&point=Nouadhibou%2C%20Mauritania&layer=MapQuest
> 
> The problem is, in quite a few countries outside of Europe, main roads can be 
> so bad that they are classified as tracks, but still used by thousands of 
> normal cars, buses and lorries. The border between Mauritania and Morocco is 
> a typical example, it is actually the only link between North and West 
> Africa..!  Maybe they should be weighted « less » than highway=unclassified, 
> but still taken in account. Any reason it is implemented this way ?
> 
> I’m using the graphhopper.com service, not my own server.
> 
> Thanks,
> Laurent
> 
> 


_______________________________________________
GraphHopper mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/graphhopper

Reply via email to