2016-01-28 10:28:44 -05:00
|
|
|
#ifndef ROUTE_STEP_HPP
|
|
|
|
#define ROUTE_STEP_HPP
|
|
|
|
|
2016-03-23 08:04:23 -04:00
|
|
|
#include "extractor/travel_mode.hpp"
|
2016-05-27 15:05:04 -04:00
|
|
|
#include "engine/guidance/step_maneuver.hpp"
|
2016-05-10 02:37:45 -04:00
|
|
|
#include "util/coordinate.hpp"
|
|
|
|
#include "util/guidance/bearing_class.hpp"
|
|
|
|
#include "util/guidance/entry_class.hpp"
|
2016-01-28 10:28:44 -05:00
|
|
|
|
2016-07-21 08:34:32 -04:00
|
|
|
#include "extractor/guidance/turn_lane_types.hpp"
|
|
|
|
#include "util/guidance/turn_lanes.hpp"
|
|
|
|
|
2016-03-03 09:34:13 -05:00
|
|
|
#include <cstddef>
|
|
|
|
|
2016-01-28 10:28:44 -05:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace osrm
|
|
|
|
{
|
|
|
|
namespace engine
|
|
|
|
{
|
|
|
|
namespace guidance
|
|
|
|
{
|
|
|
|
// Given the following turn from a,b to b,c over b:
|
|
|
|
// a --> b --> c
|
|
|
|
// this struct saves the information of the segment b,c.
|
|
|
|
// Notable exceptions are Departure and Arrival steps.
|
2016-09-05 09:01:51 -04:00
|
|
|
// Departure: s --> a --> b. Represents the segment s,a with location being s.
|
2016-01-28 10:28:44 -05:00
|
|
|
// Arrive: a --> b --> t. The segment (b,t) is already covered by the previous segment.
|
2016-05-10 02:37:45 -04:00
|
|
|
|
2016-09-05 09:01:51 -04:00
|
|
|
// A representation of intermediate intersections
|
2016-05-10 02:37:45 -04:00
|
|
|
struct Intersection
|
|
|
|
{
|
2016-05-18 11:53:05 -04:00
|
|
|
static const constexpr std::size_t NO_INDEX = std::numeric_limits<std::size_t>::max();
|
2016-05-10 02:37:45 -04:00
|
|
|
util::Coordinate location;
|
2016-05-18 11:53:05 -04:00
|
|
|
std::vector<short> bearings;
|
|
|
|
std::vector<bool> entry;
|
|
|
|
std::size_t in;
|
|
|
|
std::size_t out;
|
2016-07-21 08:34:32 -04:00
|
|
|
|
|
|
|
// turn lane information
|
|
|
|
util::guidance::LaneTupel lanes;
|
|
|
|
extractor::guidance::TurnLaneDescription lane_description;
|
2016-05-10 02:37:45 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
inline Intersection getInvalidIntersection()
|
|
|
|
{
|
2016-05-18 11:53:05 -04:00
|
|
|
return {util::Coordinate{util::FloatLongitude{0.0}, util::FloatLatitude{0.0}},
|
2016-05-27 15:05:04 -04:00
|
|
|
{},
|
|
|
|
{},
|
|
|
|
Intersection::NO_INDEX,
|
2016-07-21 08:34:32 -04:00
|
|
|
Intersection::NO_INDEX,
|
|
|
|
util::guidance::LaneTupel(),
|
|
|
|
{}};
|
2016-05-10 02:37:45 -04:00
|
|
|
}
|
|
|
|
|
2016-01-28 10:28:44 -05:00
|
|
|
struct RouteStep
|
|
|
|
{
|
|
|
|
unsigned name_id;
|
2016-02-22 16:09:50 -05:00
|
|
|
std::string name;
|
2016-09-05 09:01:51 -04:00
|
|
|
std::string ref;
|
2016-05-25 21:35:38 -04:00
|
|
|
std::string pronunciation;
|
2016-05-26 18:47:46 -04:00
|
|
|
std::string destinations;
|
2016-03-23 10:28:53 -04:00
|
|
|
std::string rotary_name;
|
2016-09-07 09:51:14 -04:00
|
|
|
std::string rotary_pronunciation;
|
2016-01-28 10:28:44 -05:00
|
|
|
double duration;
|
|
|
|
double distance;
|
|
|
|
extractor::TravelMode mode;
|
|
|
|
StepManeuver maneuver;
|
|
|
|
// indices into the locations array stored the LegGeometry
|
|
|
|
std::size_t geometry_begin;
|
|
|
|
std::size_t geometry_end;
|
2016-05-10 02:37:45 -04:00
|
|
|
std::vector<Intersection> intersections;
|
2016-01-28 10:28:44 -05:00
|
|
|
};
|
2016-05-02 09:32:28 -04:00
|
|
|
|
|
|
|
inline RouteStep getInvalidRouteStep()
|
|
|
|
{
|
2016-05-10 02:37:45 -04:00
|
|
|
return {0,
|
2016-05-25 21:35:38 -04:00
|
|
|
"",
|
2016-05-10 02:37:45 -04:00
|
|
|
"",
|
|
|
|
"",
|
2016-05-26 18:47:46 -04:00
|
|
|
"",
|
2016-09-07 09:51:14 -04:00
|
|
|
"",
|
2016-09-05 09:01:51 -04:00
|
|
|
"",
|
2016-05-10 02:37:45 -04:00
|
|
|
0,
|
|
|
|
0,
|
|
|
|
TRAVEL_MODE_INACCESSIBLE,
|
|
|
|
getInvalidStepManeuver(),
|
|
|
|
0,
|
|
|
|
0,
|
2016-05-18 11:53:05 -04:00
|
|
|
{getInvalidIntersection()}};
|
2016-05-02 09:32:28 -04:00
|
|
|
}
|
2016-01-28 10:28:44 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|