Making the turn function more flexible (#4789)

* set and store highway and access classification for the turn function
* expose highway turn classification and access turn classification and speed to the lua profile turn function
* expose whether connection road at turn is incoming or outgoing
* add lua tests for exposed information to turn function
* update docs about attributes in process_turn
* add turn_classification info to docs
* adding warning if uturn and intersection dont match
* handle u turns that do not turn into intersection[0]
* split OSM link generation in an accessible coordinate function
This commit is contained in:
Huyen Chau Nguyen
2018-01-24 15:39:55 -05:00
committed by GitHub
parent 13bb997525
commit 61e06fcaba
17 changed files with 719 additions and 146 deletions
+1 -3
View File
@@ -20,9 +20,7 @@
if (!static_cast<bool>(cond)) \
{ \
::osrm::util::FloatCoordinate c_(loc); \
std::cerr << "[Location] " \
<< "http://www.openstreetmap.org/?mlat=" << c_.lat << "&mlon=" << c_.lon \
<< "#map=19/" << c_.lat << "/" << c_.lon << '\n'; \
std::cerr << "[Location] " << c_.toOSMLink() << '\n'; \
} \
BOOST_ASSERT_MSG(cond, msg); \
} while (0)
+18
View File
@@ -34,6 +34,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <cstddef>
#include <iosfwd> //for std::ostream
#include <sstream>
#include <string>
#include <type_traits>
@@ -216,6 +217,15 @@ struct Coordinate
friend bool operator==(const Coordinate lhs, const Coordinate rhs);
friend bool operator!=(const Coordinate lhs, const Coordinate rhs);
friend std::ostream &operator<<(std::ostream &out, const Coordinate coordinate);
std::string toOSMLink() const
{
std::stringstream link;
link << "http://www.openstreetmap.org/?mlat=" << toFloating(lat)
<< "&mlon=" << toFloating(lon) << "#map=19/" << toFloating(lat) << "/"
<< toFloating(lon);
return link.str();
}
};
/**
@@ -257,6 +267,14 @@ struct FloatCoordinate
friend bool operator==(const FloatCoordinate lhs, const FloatCoordinate rhs);
friend bool operator!=(const FloatCoordinate lhs, const FloatCoordinate rhs);
friend std::ostream &operator<<(std::ostream &out, const FloatCoordinate coordinate);
std::string toOSMLink() const
{
std::stringstream link;
link << "http://www.openstreetmap.org/?mlat=" << lat << "&mlon=" << lon << "#map=19/" << lat
<< "/" << lon;
return link.str();
}
};
bool operator==(const Coordinate lhs, const Coordinate rhs);