turn lane handler moved to scenario based handling

This commit is contained in:
Moritz Kobitzsch
2016-06-30 09:31:08 +02:00
parent 802b93fa9a
commit 3b81b39998
21 changed files with 955 additions and 292 deletions
+7 -12
View File
@@ -31,11 +31,15 @@ namespace extractor
using TurnLaneDescription = guidance::TurnLaneDescription;
namespace TurnLaneType = guidance::TurnLaneType;
ExtractorCallbacks::ExtractorCallbacks(ExtractionContainers &extraction_containers)
: external_memory(extraction_containers)
ExtractorCallbacks::ExtractorCallbacks(ExtractionContainers &extraction_containers,
guidance::LaneDescriptionMap &lane_description_map)
: lane_description_map(lane_description_map), external_memory(extraction_containers)
{
// we reserved 0, 1, 2 for the empty case
string_map[MapKey("", "")] = 0;
// The map should be empty before we start initializing it
BOOST_ASSERT(lane_description_map.empty());
lane_description_map[TurnLaneDescription()] = 0;
}
@@ -165,6 +169,7 @@ void ExtractorCallbacks::ProcessWay(const osmium::Way &input_way, const Extracti
"reverse",
"merge_to_left",
"merge_to_right"};
const constexpr TurnLaneType::Mask masks_by_osm_string[num_osm_tags + 1] = {
TurnLaneType::none,
TurnLaneType::straight,
@@ -224,16 +229,6 @@ void ExtractorCallbacks::ProcessWay(const osmium::Way &input_way, const Extracti
const LaneDescriptionID new_id =
boost::numeric_cast<LaneDescriptionID>(lane_description_map.size());
lane_description_map[lane_description] = new_id;
// since we are getting a new ID, we can augment the current offsets
// and store the turn lane masks, sadly stxxl does not support insert
for (const auto mask : lane_description)
external_memory.turn_lane_masks.push_back(mask);
external_memory.turn_lane_offsets.push_back(external_memory.turn_lane_offsets.back() +
lane_description.size());
return new_id;
}
else