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
+6
View File
@@ -32,6 +32,12 @@ inline double angularDeviation(const double angle, const double from)
return std::min(360 - deviation, deviation);
}
inline bool hasRampType(const extractor::guidance::TurnInstruction instruction)
{
return instruction.type == extractor::guidance::TurnType::OffRamp ||
instruction.type == extractor::guidance::TurnType::OnRamp;
}
inline extractor::guidance::DirectionModifier::Enum getTurnDirection(const double angle)
{
// An angle of zero is a u-turn
+30
View File
@@ -0,0 +1,30 @@
#ifndef OSRM_INCLUDE_UTIL_TURN_BEARING_HPP_
#define OSRM_INCLUDE_UTIL_TURN_BEARING_HPP_
#include <cstdint>
namespace osrm
{
namespace util
{
namespace guidance
{
#pragma pack(push, 1)
class TurnBearing
{
public:
TurnBearing(const double value = 0);
double Get() const;
private:
std::uint8_t bearing;
};
#pragma pack(pop)
} // namespace guidance
} // namespace util
} // namespace osrm
#endif /* OSRM_INCLUDE_UTIL_TURN_BEARING_HPP_ */