Reworks Restriction Whitelist / Blacklist, resolves #2833
Takes a stricter aproach for whitelisting / blacklisting restrictions: - uses `restriction=` - uses more specific `restriction:<type>=` - uses `except=<type>` to invert Where `type` is the type of transportation to restrict, e.g. `motorcar`. https://github.com/Project-OSRM/osrm-backend/issues/2833
This commit is contained in:
committed by
Moritz Kobitzsch
parent
e7b2f85a20
commit
bbbbacb073
@@ -327,18 +327,17 @@ std::vector<std::string> LuaScriptingEnvironment::GetNameSuffixList()
|
||||
return suffixes_vector;
|
||||
}
|
||||
|
||||
std::vector<std::string> LuaScriptingEnvironment::GetExceptions()
|
||||
std::vector<std::string> LuaScriptingEnvironment::GetRestrictions()
|
||||
{
|
||||
auto &context = GetLuaContext();
|
||||
BOOST_ASSERT(context.state != nullptr);
|
||||
std::vector<std::string> restriction_exceptions;
|
||||
if (util::luaFunctionExists(context.state, "get_exceptions"))
|
||||
std::vector<std::string> restrictions;
|
||||
if (util::luaFunctionExists(context.state, "get_restrictions"))
|
||||
{
|
||||
// get list of turn restriction exceptions
|
||||
luabind::call_function<void>(
|
||||
context.state, "get_exceptions", boost::ref(restriction_exceptions));
|
||||
luabind::call_function<void>(context.state, "get_restrictions", boost::ref(restrictions));
|
||||
}
|
||||
return restriction_exceptions;
|
||||
return restrictions;
|
||||
}
|
||||
|
||||
void LuaScriptingEnvironment::SetupSources()
|
||||
|
||||
Reference in New Issue
Block a user