Turn Angles in OSRM were computed using a lookahead of 10 meters.

This PR adds more advanced coordinate extraction, analysing the road
to detect offsets due to OSM way modelling.

In addition it improves the handling of bearings. Right now OSM reports
bearings simply based on the very first coordinate along a way.
With this PR, we store the bearings for a turn correctly, making the
bearings for turns correct.
This commit is contained in:
Moritz Kobitzsch
2016-08-17 09:49:19 +02:00
parent 1f8ca2879f
commit 5e167b8745
62 changed files with 3451 additions and 679 deletions
+20 -4
View File
@@ -242,6 +242,10 @@ Storage::ReturnCode Storage::Run(int max_wait)
number_of_original_edges);
shared_layout_ptr->SetBlockSize<extractor::TravelMode>(SharedDataLayout::TRAVEL_MODE,
number_of_original_edges);
shared_layout_ptr->SetBlockSize<util::guidance::TurnBearing>(SharedDataLayout::PRE_TURN_BEARING,
number_of_original_edges);
shared_layout_ptr->SetBlockSize<util::guidance::TurnBearing>(
SharedDataLayout::POST_TURN_BEARING, number_of_original_edges);
shared_layout_ptr->SetBlockSize<extractor::guidance::TurnInstruction>(
SharedDataLayout::TURN_INSTRUCTION, number_of_original_edges);
shared_layout_ptr->SetBlockSize<LaneDataID>(SharedDataLayout::LANE_DATA_ID,
@@ -550,6 +554,12 @@ Storage::ReturnCode Storage::Run(int max_wait)
extractor::TravelMode *travel_mode_ptr =
shared_layout_ptr->GetBlockPtr<extractor::TravelMode, true>(shared_memory_ptr,
SharedDataLayout::TRAVEL_MODE);
util::guidance::TurnBearing *pre_turn_bearing_ptr =
shared_layout_ptr->GetBlockPtr<util::guidance::TurnBearing, true>(
shared_memory_ptr, SharedDataLayout::PRE_TURN_BEARING);
util::guidance::TurnBearing *post_turn_bearing_ptr =
shared_layout_ptr->GetBlockPtr<util::guidance::TurnBearing, true>(
shared_memory_ptr, SharedDataLayout::POST_TURN_BEARING);
LaneDataID *lane_data_id_ptr = shared_layout_ptr->GetBlockPtr<LaneDataID, true>(
shared_memory_ptr, SharedDataLayout::LANE_DATA_ID);
@@ -571,6 +581,8 @@ Storage::ReturnCode Storage::Run(int max_wait)
lane_data_id_ptr[i] = current_edge_data.lane_data_id;
turn_instructions_ptr[i] = current_edge_data.turn_instruction;
entry_class_id_ptr[i] = current_edge_data.entry_classid;
pre_turn_bearing_ptr[i] = current_edge_data.pre_turn_bearing;
post_turn_bearing_ptr[i] = current_edge_data.post_turn_bearing;
}
edges_input_stream.close();
@@ -774,20 +786,24 @@ Storage::ReturnCode Storage::Run(int max_wait)
static_cast<SharedDataTimestamp *>(data_type_memory->Ptr());
{
boost::interprocess::scoped_lock<boost::interprocess::named_upgradable_mutex>
boost::interprocess::scoped_lock<boost::interprocess::named_upgradable_mutex>
current_regions_exclusive_lock;
if (max_wait > 0)
{
util::SimpleLogger().Write() << "Waiting for " << max_wait << " seconds to write new dataset timestamp";
auto end_time = boost::posix_time::microsec_clock::universal_time() + boost::posix_time::seconds(max_wait);
util::SimpleLogger().Write() << "Waiting for " << max_wait
<< " seconds to write new dataset timestamp";
auto end_time = boost::posix_time::microsec_clock::universal_time() +
boost::posix_time::seconds(max_wait);
current_regions_exclusive_lock =
boost::interprocess::scoped_lock<boost::interprocess::named_upgradable_mutex>(
std::move(current_regions_lock), end_time);
if (!current_regions_exclusive_lock.owns())
{
util::SimpleLogger().Write(logWARNING) << "Aquiring the lock timed out after " << max_wait << " seconds. Claiming the lock by force.";
util::SimpleLogger().Write(logWARNING) << "Aquiring the lock timed out after "
<< max_wait
<< " seconds. Claiming the lock by force.";
current_regions_lock.unlock();
current_regions_lock.release();
storage::SharedBarriers::resetCurrentRegions();