But when we try de define 8 exclusion classes, the last one is not usable at runtime. The API return for this last exclusion {"message":"Exclude flag combination is not supported.","code":"InvalidValue"}
By setting 8 excludables set in the car profile.
diff --git a/profiles/car.lua b/profiles/car.lua
index 35b4178d9..68ade0023 100644
--- a/profiles/car.lua
+++ b/profiles/car.lua
@@ -116,14 +116,19 @@ function setup()
},
classes = Sequence {
- 'toll', 'motorway', 'ferry', 'restricted', 'tunnel'
+ '0', '1', '2', '3', '4', '5', '6', '7'
},
-- classes to support for exclude flags
excludable = Sequence {
- Set {'toll'},
- Set {'motorway'},
- Set {'ferry'}
+ Set {'0'},
+ Set {'1'},
+ Set {'2'},
+ Set {'3'},
+ Set {'4'},
+ Set {'5'},
+ Set {'6'},
+ Set {'7'},
},
avoid = Set {
With this profile the extract works fine (with more excludables, it raises an error).
The last exclution set doest not works.
$ for i in 0 1 2 3 4 5 6 7; do echo $i; curl "http://localhost:5000/route/v1/driving/1.5330380201339724,42.55796045336781;1.532946825027466,42.557834008579746?overview=false&exclude=${i}"; echo; done
0
{"code":"Ok","routes":[{"legs":[{"steps":[],"weight":3.8e-127,"summary":"","duration":3.8,"distance":15.8}],"weight_name":"routability","weight":3.8e-127,"duration":3.8,"distance":15.8}],"waypoints":[{"hint":"Hw4AgCAOAIAaAAAACwAAAEMAAAB_AAAAqMguQctBlEBRc-BBZJtUQhoAAAALAAAAQwAAAH8AAAAXAAAAbGQXAAhiiQJuZBcACGKJAgYATwEAAAAA","location":[1.533036,42.55796],"name":"Carrer del Turer","distance":0.1642014105},{"hint":"Hw4AgCAOAIAMAAAADAAAACsAAACkAAAAwFilQMd-mkC5fZBB5GqJQgwAAAAMAAAAKwAAAKQAAAAXAAAAJmQXAIRhiQITZBcAimGJAgQAbwEAAAAA","location":[1.532966,42.557828],"name":"Carrer del Turer","distance":1.69633755}]}
1
{"code":"Ok","routes":[{"legs":[{"steps":[],"weight":3.8e-127,"summary":"","duration":3.8,"distance":15.8}],"weight_name":"routability","weight":3.8e-127,"duration":3.8,"distance":15.8}],"waypoints":[{"hint":"Hw4AgCAOAIAaAAAACwAAAEMAAAB_AAAAqMguQctBlEBRc-BBZJtUQhoAAAALAAAAQwAAAH8AAAAXAAAAbGQXAAhiiQJuZBcACGKJAgYATwEAAAAA","location":[1.533036,42.55796],"name":"Carrer del Turer","distance":0.1642014105},{"hint":"Hw4AgCAOAIAMAAAADAAAACsAAACkAAAAwFilQMd-mkC5fZBB5GqJQgwAAAAMAAAAKwAAAKQAAAAXAAAAJmQXAIRhiQITZBcAimGJAgQAbwEAAAAA","location":[1.532966,42.557828],"name":"Carrer del Turer","distance":1.69633755}]}
2
{"code":"Ok","routes":[{"legs":[{"steps":[],"weight":3.8e-127,"summary":"","duration":3.8,"distance":15.8}],"weight_name":"routability","weight":3.8e-127,"duration":3.8,"distance":15.8}],"waypoints":[{"hint":"Hw4AgCAOAIAaAAAACwAAAEMAAAB_AAAAqMguQctBlEBRc-BBZJtUQhoAAAALAAAAQwAAAH8AAAAXAAAAbGQXAAhiiQJuZBcACGKJAgYATwEAAAAA","location":[1.533036,42.55796],"name":"Carrer del Turer","distance":0.1642014105},{"hint":"Hw4AgCAOAIAMAAAADAAAACsAAACkAAAAwFilQMd-mkC5fZBB5GqJQgwAAAAMAAAAKwAAAKQAAAAXAAAAJmQXAIRhiQITZBcAimGJAgQAbwEAAAAA","location":[1.532966,42.557828],"name":"Carrer del Turer","distance":1.69633755}]}
3
{"code":"Ok","routes":[{"legs":[{"steps":[],"weight":3.8e-127,"summary":"","duration":3.8,"distance":15.8}],"weight_name":"routability","weight":3.8e-127,"duration":3.8,"distance":15.8}],"waypoints":[{"hint":"Hw4AgCAOAIAaAAAACwAAAEMAAAB_AAAAqMguQctBlEBRc-BBZJtUQhoAAAALAAAAQwAAAH8AAAAXAAAAbGQXAAhiiQJuZBcACGKJAgYATwEAAAAA","location":[1.533036,42.55796],"name":"Carrer del Turer","distance":0.1642014105},{"hint":"Hw4AgCAOAIAMAAAADAAAACsAAACkAAAAwFilQMd-mkC5fZBB5GqJQgwAAAAMAAAAKwAAAKQAAAAXAAAAJmQXAIRhiQITZBcAimGJAgQAbwEAAAAA","location":[1.532966,42.557828],"name":"Carrer del Turer","distance":1.69633755}]}
4
{"code":"Ok","routes":[{"legs":[{"steps":[],"weight":3.8e-127,"summary":"","duration":3.8,"distance":15.8}],"weight_name":"routability","weight":3.8e-127,"duration":3.8,"distance":15.8}],"waypoints":[{"hint":"Hw4AgCAOAIAaAAAACwAAAEMAAAB_AAAAqMguQctBlEBRc-BBZJtUQhoAAAALAAAAQwAAAH8AAAAXAAAAbGQXAAhiiQJuZBcACGKJAgYATwEAAAAA","location":[1.533036,42.55796],"name":"Carrer del Turer","distance":0.1642014105},{"hint":"Hw4AgCAOAIAMAAAADAAAACsAAACkAAAAwFilQMd-mkC5fZBB5GqJQgwAAAAMAAAAKwAAAKQAAAAXAAAAJmQXAIRhiQITZBcAimGJAgQAbwEAAAAA","location":[1.532966,42.557828],"name":"Carrer del Turer","distance":1.69633755}]}
5
{"code":"Ok","routes":[{"legs":[{"steps":[],"weight":3.8e-127,"summary":"","duration":3.8,"distance":15.8}],"weight_name":"routability","weight":3.8e-127,"duration":3.8,"distance":15.8}],"waypoints":[{"hint":"Hw4AgCAOAIAaAAAACwAAAEMAAAB_AAAAqMguQctBlEBRc-BBZJtUQhoAAAALAAAAQwAAAH8AAAAXAAAAbGQXAAhiiQJuZBcACGKJAgYATwEAAAAA","location":[1.533036,42.55796],"name":"Carrer del Turer","distance":0.1642014105},{"hint":"Hw4AgCAOAIAMAAAADAAAACsAAACkAAAAwFilQMd-mkC5fZBB5GqJQgwAAAAMAAAAKwAAAKQAAAAXAAAAJmQXAIRhiQITZBcAimGJAgQAbwEAAAAA","location":[1.532966,42.557828],"name":"Carrer del Turer","distance":1.69633755}]}
6
{"code":"Ok","routes":[{"legs":[{"steps":[],"weight":3.8e-127,"summary":"","duration":3.8,"distance":15.8}],"weight_name":"routability","weight":3.8e-127,"duration":3.8,"distance":15.8}],"waypoints":[{"hint":"Hw4AgCAOAIAaAAAACwAAAEMAAAB_AAAAqMguQctBlEBRc-BBZJtUQhoAAAALAAAAQwAAAH8AAAAXAAAAbGQXAAhiiQJuZBcACGKJAgYATwEAAAAA","location":[1.533036,42.55796],"name":"Carrer del Turer","distance":0.1642014105},{"hint":"Hw4AgCAOAIAMAAAADAAAACsAAACkAAAAwFilQMd-mkC5fZBB5GqJQgwAAAAMAAAAKwAAAKQAAAAXAAAAJmQXAIRhiQITZBcAimGJAgQAbwEAAAAA","location":[1.532966,42.557828],"name":"Carrer del Turer","distance":1.69633755}]}
7
{"message":"Exclude flag combination is not supported.","code":"InvalidValue"}
As 0 index and mask are for no exclusion (right?), it looks like to me only 7 excludate sets should be allowed. And so the fix could be
Issue
MAX_EXCLUDABLE_CLASSESis set 8, and then the number of exclusion sets is checked withexcludable_classes.size() > MAX_EXCLUDABLE_CLASSESto raise error.But when we try de define 8 exclusion classes, the last one is not usable at runtime. The API return for this last exclusion
{"message":"Exclude flag combination is not supported.","code":"InvalidValue"}Steps to reproduce
By setting 8 excludables set in the car profile.
With this profile the extract works fine (with more excludables, it raises an error).
The last exclution set doest not works.
Fix
class_data.hpp
extractor.cpp
As 0 index and mask are for no exclusion (right?), it looks like to me only 7 excludate sets should be allowed. And so the fix could be