GIScience / openrouteservice

🌍 The open source route planner api with plenty of features.
https://openrouteservice.org
GNU General Public License v3.0
1.43k stars 392 forks source link

Faulty logic when determining vehicle flags in HeavyVehicleGraphStorageBuilder #211

Closed aoles closed 5 years ago

aoles commented 6 years ago

When setting _hgvType flags based on OSM vehicle tags such as goodsTag in the following code block the variable busTag is used when checking for equality with "yes". https://github.com/GIScience/openrouteservice/blob/1156e1d34af87f04da6920df7a9e138468dd6f70/openrouteservice/src/main/java/heigit/ors/routing/graphhopper/extensions/storages/builders/HeavyVehicleGraphStorageBuilder.java#L227-L237

The same is true for the subseqent code blocks for hgvTag, agriculturalTag, forestryTag and deliveryTag.

I believe the usage of busTag in this context is incorrect and should be replaced by the tag variable appropriate for the vehicle type considered, the same which is used to check the equality with "no" or "destination".

aoles commented 6 years ago

Test case on way 125388816: http://maps.openrouteservice.org/directions?n1=49.348238&n2=8.766859&n3=17&a=49.348151,8.768002,49.348123,8.765674&b=0&c=0&k1=en-US&k2=km

Regular car/hgv is allowed but not agricultural even though the way specifically allows them agricultural=yes.

aoles commented 6 years ago

I cannot find any good reason why access for agricultural and forestry vehicles is disabled by default for highway=tracks but enabled on other types of ways. For example, it's possible to route down the following way with any motor vehicle but agricultural/forestry (when ALT is enabled). Similar applies to the example from the previous comment.

https://maps.openrouteservice.org/directions?n1=49.385645&n2=8.847658&n3=17&a=49.387283,8.846183,49.384307,8.849713&b=4d&c=0&k1=en-US&k2=km

aoles commented 6 years ago

Yet another example on Leimer Straße which fails for driving agricultural: https://maps.openrouteservice.org/directions?n1=49.371137&n2=8.689848&n3=17&a=49.368262,8.691226,49.370882,8.69157&b=4d&c=0&f5=2&k1=en-US&k2=km