Fixed bug filling the MapBuilder

This commit is contained in:
Marc 2018-10-16 14:32:32 +02:00
parent 7236bfc2fe
commit a018135b0f
1 changed files with 45 additions and 41 deletions

View File

@ -80,13 +80,18 @@ namespace opendrive {
} else {
roadSegment.AddSuccessorID(it->second->road_link.successor->id);
}
}
if (it->second->road_link.predecessor != nullptr) {
if (it->second->road_link.predecessor->element_type == "junction") {
std::vector<lane_junction_t> &options =
junctionsData[it->second->road_link.predecessor->id][it->first];
for (size_t i = 0; i < options.size(); ++i) {
roadSegment.AddPredecessorID(options[i].connection_road);
}
} else {
roadSegment.AddPredecessorID(it->second->road_link.predecessor->id);
}
}
for (size_t i = 0; i < it->second->geometry_attributes.size(); ++i) {
@ -142,7 +147,6 @@ namespace opendrive {
mapBuilder.AddRoadSegmentDefinition(roadSegment);
}
}
return mapBuilder.Build();
}