refactor restriction parsing / extraction to actual types

Makes turn restrictions into dedicated structures and diferentiates between them via a variant.
Ensures that we do not accidentally mess up ID types within our application.
In addition this improves the restriction performance by only parsing all edges
once at the cost of (at the time of writing) 22MB in terms of main memory usage.
This commit is contained in:
Moritz Kobitzsch
2017-07-06 17:09:24 +02:00
parent 1f7aa6f812
commit 2e9a7d9c1a
21 changed files with 876 additions and 461 deletions
+4 -11
View File
@@ -73,19 +73,12 @@ void ExtractorCallbacks::ProcessNode(const osmium::Node &input_node,
}
}
void ExtractorCallbacks::ProcessRestriction(
const boost::optional<InputRestrictionContainer> &restriction)
void ExtractorCallbacks::ProcessRestriction(const InputConditionalTurnRestriction &restriction)
{
if (restriction)
{
external_memory.restrictions_list.push_back(restriction.get());
// util::Log() << "from: " << restriction.get().restriction.from.node <<
// ",via: " << restriction.get().restriction.via.node <<
// ", to: " << restriction.get().restriction.to.node <<
// ", only: " << (restriction.get().restriction.flags.is_only ?
// "y" : "n");
}
external_memory.restrictions_list.push_back(restriction);
// util::Log() << restriction.toString();
}
/**
* Takes the geometry contained in the ```input_way``` and the tags computed
* by the lua profile inside ```parsed_way``` and computes all edge segments.