Complete support for no_entry and no_exit turn restrictions (#5988)

The internal representation of turn restrictions expects only one
`from` way and only one `to` way.

`no_entry` and `no_exit` turn restrictions can have multiple `from` and
`to` ways respectively. This means they are not fully supported by
OSRM's restriction parser.

We complete support for these turn restriction types by parsing all
ways and converting a valid restriction with multiple `from`/`to` members
into multiple internal restrictions.
This commit is contained in:
Michael Bell
2022-08-22 12:58:16 +01:00
committed by GitHub
parent b4b1aea567
commit 3cfd0e8334
5 changed files with 184 additions and 31 deletions
+5 -3
View File
@@ -909,13 +909,15 @@ void Sol2ScriptingEnvironment::ProcessElements(
case osmium::item_type::relation:
{
const auto &relation = static_cast<const osmium::Relation &>(*entity);
if (auto result_res = restriction_parser.TryParse(relation))
auto results = restriction_parser.TryParse(relation);
if (!results.empty())
{
resulting_restrictions.push_back(*result_res);
std::move(
results.begin(), results.end(), std::back_inserter(resulting_restrictions));
}
else if (auto result_res = maneuver_override_parser.TryParse(relation))
{
resulting_maneuver_overrides.push_back(*result_res);
resulting_maneuver_overrides.push_back(std::move(*result_res));
}
}
break;