Format with clang-format 3.8
This commit is contained in:
@@ -11,10 +11,10 @@
|
||||
#include "extractor/query_node.hpp"
|
||||
#include "extractor/restriction_map.hpp"
|
||||
|
||||
#include "util/guidance/bearing_class.hpp"
|
||||
#include "util/guidance/entry_class.hpp"
|
||||
#include "extractor/guidance/turn_analysis.hpp"
|
||||
#include "extractor/guidance/turn_instruction.hpp"
|
||||
#include "util/guidance/bearing_class.hpp"
|
||||
#include "util/guidance/entry_class.hpp"
|
||||
|
||||
#include "util/deallocating_vector.hpp"
|
||||
#include "util/name_table.hpp"
|
||||
|
||||
@@ -21,8 +21,8 @@ struct EdgeBasedNode
|
||||
{
|
||||
EdgeBasedNode()
|
||||
: forward_segment_id{SPECIAL_SEGMENTID, false},
|
||||
reverse_segment_id{SPECIAL_SEGMENTID, false}, u(SPECIAL_NODEID),
|
||||
v(SPECIAL_NODEID), name_id(0), forward_packed_geometry_id(SPECIAL_EDGEID),
|
||||
reverse_segment_id{SPECIAL_SEGMENTID, false}, u(SPECIAL_NODEID), v(SPECIAL_NODEID),
|
||||
name_id(0), forward_packed_geometry_id(SPECIAL_EDGEID),
|
||||
reverse_packed_geometry_id(SPECIAL_EDGEID), component{INVALID_COMPONENTID, false},
|
||||
fwd_segment_position(std::numeric_limits<unsigned short>::max()),
|
||||
forward_travel_mode(TRAVEL_MODE_INACCESSIBLE),
|
||||
@@ -42,15 +42,13 @@ struct EdgeBasedNode
|
||||
unsigned short fwd_segment_position,
|
||||
TravelMode forward_travel_mode,
|
||||
TravelMode backward_travel_mode)
|
||||
: forward_segment_id(forward_segment_id_),
|
||||
reverse_segment_id(reverse_segment_id_), u(u), v(v), name_id(name_id),
|
||||
forward_packed_geometry_id(forward_geometry_id_),
|
||||
: forward_segment_id(forward_segment_id_), reverse_segment_id(reverse_segment_id_), u(u),
|
||||
v(v), name_id(name_id), forward_packed_geometry_id(forward_geometry_id_),
|
||||
reverse_packed_geometry_id(reverse_geometry_id_),
|
||||
component{component_id, is_tiny_component}, fwd_segment_position(fwd_segment_position),
|
||||
forward_travel_mode(forward_travel_mode), backward_travel_mode(backward_travel_mode)
|
||||
{
|
||||
BOOST_ASSERT(forward_segment_id.enabled ||
|
||||
reverse_segment_id.enabled);
|
||||
BOOST_ASSERT(forward_segment_id.enabled || reverse_segment_id.enabled);
|
||||
}
|
||||
|
||||
SegmentID forward_segment_id; // needed for edge-expanded graph
|
||||
|
||||
@@ -25,15 +25,17 @@ struct ExternalMemoryNode : QueryNode
|
||||
|
||||
static ExternalMemoryNode min_value()
|
||||
{
|
||||
return ExternalMemoryNode(util::FixedLongitude(0), util::FixedLatitude(0), MIN_OSM_NODEID,
|
||||
false, false);
|
||||
return ExternalMemoryNode(
|
||||
util::FixedLongitude(0), util::FixedLatitude(0), MIN_OSM_NODEID, false, false);
|
||||
}
|
||||
|
||||
static ExternalMemoryNode max_value()
|
||||
{
|
||||
return ExternalMemoryNode(util::FixedLongitude(std::numeric_limits<int>::max()),
|
||||
util::FixedLatitude(std::numeric_limits<int>::max()),
|
||||
MAX_OSM_NODEID, false, false);
|
||||
MAX_OSM_NODEID,
|
||||
false,
|
||||
false);
|
||||
}
|
||||
|
||||
bool barrier;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#ifndef EXTRACTION_CONTAINERS_HPP
|
||||
#define EXTRACTION_CONTAINERS_HPP
|
||||
|
||||
#include "extractor/internal_extractor_edge.hpp"
|
||||
#include "extractor/first_and_last_segment_of_way.hpp"
|
||||
#include "extractor/scripting_environment.hpp"
|
||||
#include "extractor/external_memory_node.hpp"
|
||||
#include "extractor/first_and_last_segment_of_way.hpp"
|
||||
#include "extractor/internal_extractor_edge.hpp"
|
||||
#include "extractor/restriction.hpp"
|
||||
#include "extractor/scripting_environment.hpp"
|
||||
|
||||
#include <stxxl/vector>
|
||||
#include <unordered_map>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#ifndef EXTRACTION_HELPER_FUNCTIONS_HPP
|
||||
#define EXTRACTION_HELPER_FUNCTIONS_HPP
|
||||
|
||||
#include <boost/spirit/include/qi.hpp>
|
||||
#include <boost/spirit/include/phoenix.hpp>
|
||||
#include <boost/spirit/include/qi.hpp>
|
||||
|
||||
#include <limits>
|
||||
#include <string>
|
||||
@@ -19,8 +19,7 @@ namespace qi = boost::spirit::qi;
|
||||
|
||||
template <typename Iterator> struct iso_8601_grammar : qi::grammar<Iterator, unsigned()>
|
||||
{
|
||||
iso_8601_grammar()
|
||||
: iso_8601_grammar::base_type(root)
|
||||
iso_8601_grammar() : iso_8601_grammar::base_type(root)
|
||||
|
||||
{
|
||||
using qi::_1;
|
||||
@@ -38,50 +37,38 @@ template <typename Iterator> struct iso_8601_grammar : qi::grammar<Iterator, uns
|
||||
mm = uint2_p[_pass = bind([](unsigned x) { return x < 60; }, _1), _val = _1];
|
||||
ss = uint2_p[_pass = bind([](unsigned x) { return x < 60; }, _1), _val = _1];
|
||||
|
||||
osm_time
|
||||
= (uint_p[_a = _1] >> eoi) [_val = _a * 60]
|
||||
| (uint_p[_a = _1] >> ':' >> uint_p[_b = _1] >> eoi) [_val = _a * 3600 + _b * 60]
|
||||
| (uint_p[_a = _1] >> ':' >> uint_p[_b = _1] >> ':' >> uint_p[_c = _1] >> eoi) [_val = _a * 3600 + _b * 60 + _c]
|
||||
;
|
||||
osm_time = (uint_p[_a = _1] >> eoi)[_val = _a * 60] |
|
||||
(uint_p[_a = _1] >> ':' >> uint_p[_b = _1] >> eoi)[_val = _a * 3600 + _b * 60] |
|
||||
(uint_p[_a = _1] >> ':' >> uint_p[_b = _1] >> ':' >> uint_p[_c = _1] >>
|
||||
eoi)[_val = _a * 3600 + _b * 60 + _c];
|
||||
|
||||
alternative_time
|
||||
= ('T' >> hh[_a = _1] >> mm[_b = _1] >> ss[_c = _1]) [_val = _a * 3600 + _b * 60 + _c]
|
||||
;
|
||||
alternative_time =
|
||||
('T' >> hh[_a = _1] >> mm[_b = _1] >> ss[_c = _1])[_val = _a * 3600 + _b * 60 + _c];
|
||||
|
||||
extended_time
|
||||
= ('T' >> hh[_a = _1] >> ':' >> mm[_b = _1] >> ':' >> ss[_c = _1]) [_val = _a * 3600 + _b * 60 + _c]
|
||||
;
|
||||
extended_time = ('T' >> hh[_a = _1] >> ':' >> mm[_b = _1] >> ':' >>
|
||||
ss[_c = _1])[_val = _a * 3600 + _b * 60 + _c];
|
||||
|
||||
standard_time
|
||||
= ('T'
|
||||
>> -(uint_ >> char_("Hh"))[_a = _1]
|
||||
>> -(uint_ >> char_("Mm"))[_b = _1]
|
||||
>> -(uint_ >> char_("Ss"))[_c = _1]) [_val = _a * 3600 + _b * 60 + _c]
|
||||
;
|
||||
standard_time =
|
||||
('T' >> -(uint_ >> char_("Hh"))[_a = _1] >> -(uint_ >> char_("Mm"))[_b = _1] >>
|
||||
-(uint_ >> char_("Ss"))[_c = _1])[_val = _a * 3600 + _b * 60 + _c];
|
||||
|
||||
standard_date
|
||||
= (uint_ >> char_("Dd")) [_val = _1 * 86400]
|
||||
;
|
||||
standard_date = (uint_ >> char_("Dd"))[_val = _1 * 86400];
|
||||
|
||||
standard_week
|
||||
= (uint_ >> char_("Ww")) [_val = _1 * 604800]
|
||||
;
|
||||
standard_week = (uint_ >> char_("Ww"))[_val = _1 * 604800];
|
||||
|
||||
iso_period
|
||||
= osm_time [_val = _1]
|
||||
| ('P' >> standard_week >> eoi) [_val = _1]
|
||||
| ('P' >> ( alternative_time[_a = 0, _b = _1]
|
||||
| extended_time[_a = 0, _b = _1]
|
||||
| (eps[_a = 0, _b = 0] >> -standard_date[_a = _1] >> -standard_time[_b = _1] ) )
|
||||
>> eoi) [_val = _a + _b]
|
||||
;
|
||||
iso_period =
|
||||
osm_time[_val = _1] | ('P' >> standard_week >> eoi)[_val = _1] |
|
||||
('P' >> (alternative_time[_a = 0, _b = _1] | extended_time[_a = 0, _b = _1] |
|
||||
(eps[_a = 0, _b = 0] >> -standard_date[_a = _1] >> -standard_time[_b = _1])) >>
|
||||
eoi)[_val = _a + _b];
|
||||
|
||||
root = iso_period;
|
||||
}
|
||||
|
||||
qi::rule<Iterator, unsigned()> root;
|
||||
qi::rule<Iterator, unsigned(), qi::locals<unsigned, unsigned>> iso_period;
|
||||
qi::rule<Iterator, unsigned(), qi::locals<unsigned, unsigned, unsigned>> osm_time, standard_time, alternative_time, extended_time;
|
||||
qi::rule<Iterator, unsigned(), qi::locals<unsigned, unsigned, unsigned>> osm_time,
|
||||
standard_time, alternative_time, extended_time;
|
||||
qi::rule<Iterator, unsigned()> standard_date, standard_week;
|
||||
qi::rule<Iterator, unsigned()> hh, mm, ss;
|
||||
|
||||
@@ -111,7 +98,6 @@ inline unsigned parseDuration(const std::string &s)
|
||||
|
||||
return !s.empty() && iter == s.end() ? duration : std::numeric_limits<unsigned>::max();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,8 +30,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#include <boost/filesystem/path.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <array>
|
||||
#include <string>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
@@ -72,7 +72,7 @@ struct ExtractorConfig
|
||||
edge_penalty_path = basepath + ".osrm.edge_penalties";
|
||||
edge_based_node_weights_output_path = basepath + ".osrm.enw";
|
||||
profile_properties_output_path = basepath + ".osrm.properties";
|
||||
intersection_class_data_output_path = basepath + ".osrm.icd";
|
||||
intersection_class_data_output_path = basepath + ".osrm.icd";
|
||||
}
|
||||
|
||||
boost::filesystem::path config_file_path;
|
||||
|
||||
@@ -9,10 +9,10 @@ namespace guidance
|
||||
{
|
||||
enum class RoundaboutType
|
||||
{
|
||||
None, // not a roundabout
|
||||
Roundabout, // standard roundabout
|
||||
Rotary, // traffic circle (large roundabout) with dedicated name
|
||||
RoundaboutIntersection // small roundabout with distinct turns, handled as intersection
|
||||
None, // not a roundabout
|
||||
Roundabout, // standard roundabout
|
||||
Rotary, // traffic circle (large roundabout) with dedicated name
|
||||
RoundaboutIntersection // small roundabout with distinct turns, handled as intersection
|
||||
};
|
||||
} /* namespace guidance */
|
||||
} /* namespace extractor */
|
||||
|
||||
@@ -70,7 +70,8 @@ getCoordinateFromCompressedRange(util::Coordinate current_coordinate,
|
||||
};
|
||||
|
||||
for (auto compressed_geometry_itr = compressed_geometry_begin;
|
||||
compressed_geometry_itr != compressed_geometry_end; ++compressed_geometry_itr)
|
||||
compressed_geometry_itr != compressed_geometry_end;
|
||||
++compressed_geometry_itr)
|
||||
{
|
||||
const auto next_coordinate =
|
||||
extractCoordinateFromNode(query_nodes[compressed_geometry_itr->node_id]);
|
||||
@@ -82,7 +83,8 @@ getCoordinateFromCompressedRange(util::Coordinate current_coordinate,
|
||||
if (distance_to_next_coordinate >= detail::DESIRED_SEGMENT_LENGTH)
|
||||
return util::coordinate_calculation::interpolateLinear(
|
||||
getFactor(distance_to_current_coordinate, distance_to_next_coordinate),
|
||||
current_coordinate, next_coordinate);
|
||||
current_coordinate,
|
||||
next_coordinate);
|
||||
|
||||
// prepare for next iteration
|
||||
current_coordinate = next_coordinate;
|
||||
@@ -98,7 +100,8 @@ getCoordinateFromCompressedRange(util::Coordinate current_coordinate,
|
||||
distance_to_next_coordinate >= detail::DESIRED_SEGMENT_LENGTH)
|
||||
return util::coordinate_calculation::interpolateLinear(
|
||||
getFactor(distance_to_current_coordinate, distance_to_next_coordinate),
|
||||
current_coordinate, final_coordinate);
|
||||
current_coordinate,
|
||||
final_coordinate);
|
||||
else
|
||||
return final_coordinate;
|
||||
}
|
||||
@@ -280,10 +283,14 @@ inline double getTurnConfidence(const double angle, TurnInstruction instruction)
|
||||
// swaps left <-> right modifier types
|
||||
inline DirectionModifier::Enum mirrorDirectionModifier(const DirectionModifier::Enum modifier)
|
||||
{
|
||||
const constexpr DirectionModifier::Enum results[] = {
|
||||
DirectionModifier::UTurn, DirectionModifier::SharpLeft, DirectionModifier::Left,
|
||||
DirectionModifier::SlightLeft, DirectionModifier::Straight, DirectionModifier::SlightRight,
|
||||
DirectionModifier::Right, DirectionModifier::SharpRight};
|
||||
const constexpr DirectionModifier::Enum results[] = {DirectionModifier::UTurn,
|
||||
DirectionModifier::SharpLeft,
|
||||
DirectionModifier::Left,
|
||||
DirectionModifier::SlightLeft,
|
||||
DirectionModifier::Straight,
|
||||
DirectionModifier::SlightRight,
|
||||
DirectionModifier::Right,
|
||||
DirectionModifier::SharpRight};
|
||||
return results[modifier];
|
||||
}
|
||||
|
||||
@@ -380,8 +387,10 @@ inline bool requiresNameAnnounced(const std::string &from,
|
||||
return false;
|
||||
if (!checkTable(first_prefix_and_suffixes.first))
|
||||
return false;
|
||||
return !first.compare(first_prefix_and_suffixes.first.length(), std::string::npos,
|
||||
second, second_prefix_and_suffixes.first.length(),
|
||||
return !first.compare(first_prefix_and_suffixes.first.length(),
|
||||
std::string::npos,
|
||||
second,
|
||||
second_prefix_and_suffixes.first.length(),
|
||||
std::string::npos);
|
||||
}();
|
||||
|
||||
@@ -390,8 +399,10 @@ inline bool requiresNameAnnounced(const std::string &from,
|
||||
return false;
|
||||
if (!checkTable(first_prefix_and_suffixes.second))
|
||||
return false;
|
||||
return !first.compare(0, first.length() - first_prefix_and_suffixes.second.length(),
|
||||
second, 0,
|
||||
return !first.compare(0,
|
||||
first.length() - first_prefix_and_suffixes.second.length(),
|
||||
second,
|
||||
0,
|
||||
second.length() - second_prefix_and_suffixes.second.length());
|
||||
}();
|
||||
|
||||
@@ -421,8 +432,8 @@ inline int getPriority(const FunctionalRoadClass road_class)
|
||||
// The road priorities indicate which roads can bee seen as more or less equal.
|
||||
// They are used in Fork-Discovery. Possibly should be moved to profiles post v5?
|
||||
// A fork can happen between road types that are at most 1 priority apart from each other
|
||||
const constexpr int road_priority[] = {10, 0, 10, 2, 10, 4, 10, 6,
|
||||
10, 8, 10, 11, 10, 12, 10, 14};
|
||||
const constexpr int road_priority[] = {
|
||||
10, 0, 10, 2, 10, 4, 10, 6, 10, 8, 10, 11, 10, 12, 10, 14};
|
||||
return road_priority[static_cast<int>(road_class)];
|
||||
}
|
||||
|
||||
@@ -441,10 +452,14 @@ inline bool canBeSeenAsFork(const FunctionalRoadClass first, const FunctionalRoa
|
||||
// turn and vice versa.
|
||||
inline ConnectedRoad mirror(ConnectedRoad road)
|
||||
{
|
||||
const constexpr DirectionModifier::Enum mirrored_modifiers[] = {
|
||||
DirectionModifier::UTurn, DirectionModifier::SharpLeft, DirectionModifier::Left,
|
||||
DirectionModifier::SlightLeft, DirectionModifier::Straight, DirectionModifier::SlightRight,
|
||||
DirectionModifier::Right, DirectionModifier::SharpRight};
|
||||
const constexpr DirectionModifier::Enum mirrored_modifiers[] = {DirectionModifier::UTurn,
|
||||
DirectionModifier::SharpLeft,
|
||||
DirectionModifier::Left,
|
||||
DirectionModifier::SlightLeft,
|
||||
DirectionModifier::Straight,
|
||||
DirectionModifier::SlightRight,
|
||||
DirectionModifier::Right,
|
||||
DirectionModifier::SharpRight};
|
||||
|
||||
if (angularDeviation(road.turn.angle, 0) > std::numeric_limits<double>::epsilon())
|
||||
{
|
||||
|
||||
@@ -1,23 +1,21 @@
|
||||
#ifndef OSRM_GUIDANCE_TURN_CLASSIFICATION_HPP_
|
||||
#define OSRM_GUIDANCE_TURN_CLASSIFICATION_HPP_
|
||||
|
||||
#include "extractor/compressed_edge_container.hpp"
|
||||
#include "extractor/guidance/intersection.hpp"
|
||||
#include "extractor/guidance/toolkit.hpp"
|
||||
#include "extractor/compressed_edge_container.hpp"
|
||||
#include "extractor/query_node.hpp"
|
||||
|
||||
#include "util/guidance/entry_class.hpp"
|
||||
#include "util/guidance/bearing_class.hpp"
|
||||
#include "util/coordinate.hpp"
|
||||
#include "util/guidance/bearing_class.hpp"
|
||||
#include "util/guidance/entry_class.hpp"
|
||||
#include "util/node_based_graph.hpp"
|
||||
#include "util/typedefs.hpp"
|
||||
|
||||
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstddef>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
@@ -26,7 +24,7 @@ namespace extractor
|
||||
namespace guidance
|
||||
{
|
||||
|
||||
std::pair<util::guidance::EntryClass,util::guidance::BearingClass>
|
||||
std::pair<util::guidance::EntryClass, util::guidance::BearingClass>
|
||||
classifyIntersection(NodeID nid,
|
||||
const Intersection &intersection,
|
||||
const util::NodeBasedDynamicGraph &node_based_graph,
|
||||
|
||||
@@ -101,7 +101,9 @@ struct TurnInstruction
|
||||
const DirectionModifier::Enum modifier)
|
||||
{
|
||||
const constexpr TurnType::Enum enter_instruction[] = {
|
||||
TurnType::Invalid, TurnType::EnterRoundabout, TurnType::EnterRotary,
|
||||
TurnType::Invalid,
|
||||
TurnType::EnterRoundabout,
|
||||
TurnType::EnterRotary,
|
||||
TurnType::EnterRoundaboutIntersection};
|
||||
return {enter_instruction[static_cast<int>(roundabout_type)], modifier};
|
||||
}
|
||||
@@ -109,9 +111,10 @@ struct TurnInstruction
|
||||
static TurnInstruction EXIT_ROUNDABOUT(const RoundaboutType roundabout_type,
|
||||
const DirectionModifier::Enum modifier)
|
||||
{
|
||||
const constexpr TurnType::Enum exit_instruction[] = {
|
||||
TurnType::Invalid, TurnType::ExitRoundabout, TurnType::ExitRotary,
|
||||
TurnType::ExitRoundaboutIntersection};
|
||||
const constexpr TurnType::Enum exit_instruction[] = {TurnType::Invalid,
|
||||
TurnType::ExitRoundabout,
|
||||
TurnType::ExitRotary,
|
||||
TurnType::ExitRoundaboutIntersection};
|
||||
return {exit_instruction[static_cast<int>(roundabout_type)], modifier};
|
||||
}
|
||||
|
||||
@@ -119,7 +122,9 @@ struct TurnInstruction
|
||||
const DirectionModifier::Enum modifier)
|
||||
{
|
||||
const constexpr TurnType::Enum exit_instruction[] = {
|
||||
TurnType::Invalid, TurnType::EnterAndExitRoundabout, TurnType::EnterAndExitRotary,
|
||||
TurnType::Invalid,
|
||||
TurnType::EnterAndExitRoundabout,
|
||||
TurnType::EnterAndExitRotary,
|
||||
TurnType::EnterAndExitRoundaboutIntersection};
|
||||
return {exit_instruction[static_cast<int>(roundabout_type)], modifier};
|
||||
}
|
||||
@@ -128,7 +133,9 @@ struct TurnInstruction
|
||||
const DirectionModifier::Enum modifier)
|
||||
{
|
||||
const constexpr TurnType::Enum enter_instruction[] = {
|
||||
TurnType::Invalid, TurnType::EnterRoundaboutAtExit, TurnType::EnterRotaryAtExit,
|
||||
TurnType::Invalid,
|
||||
TurnType::EnterRoundaboutAtExit,
|
||||
TurnType::EnterRotaryAtExit,
|
||||
TurnType::EnterRoundaboutIntersectionAtExit};
|
||||
return {enter_instruction[static_cast<int>(roundabout_type)], modifier};
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
#ifndef INTERNAL_EXTRACTOR_EDGE_HPP
|
||||
#define INTERNAL_EXTRACTOR_EDGE_HPP
|
||||
|
||||
#include "util/typedefs.hpp"
|
||||
#include "extractor/travel_mode.hpp"
|
||||
#include "extractor/node_based_edge.hpp"
|
||||
#include "extractor/travel_mode.hpp"
|
||||
#include "util/typedefs.hpp"
|
||||
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
#include "extractor/guidance/classification_data.hpp"
|
||||
#include "osrm/coordinate.hpp"
|
||||
#include <utility>
|
||||
#include "extractor/guidance/classification_data.hpp"
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
@@ -32,8 +32,7 @@ struct InternalExtractorEdge
|
||||
|
||||
WeightData() : duration(0.0), type(WeightType::INVALID) {}
|
||||
|
||||
union
|
||||
{
|
||||
union {
|
||||
double duration;
|
||||
double speed;
|
||||
};
|
||||
@@ -94,14 +93,32 @@ struct InternalExtractorEdge
|
||||
// necessary static util functions for stxxl's sorting
|
||||
static InternalExtractorEdge min_osm_value()
|
||||
{
|
||||
return InternalExtractorEdge(MIN_OSM_NODEID, MIN_OSM_NODEID, 0, WeightData(), false, false,
|
||||
false, false, true, TRAVEL_MODE_INACCESSIBLE, false,
|
||||
return InternalExtractorEdge(MIN_OSM_NODEID,
|
||||
MIN_OSM_NODEID,
|
||||
0,
|
||||
WeightData(),
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
TRAVEL_MODE_INACCESSIBLE,
|
||||
false,
|
||||
guidance::RoadClassificationData());
|
||||
}
|
||||
static InternalExtractorEdge max_osm_value()
|
||||
{
|
||||
return InternalExtractorEdge(MAX_OSM_NODEID, MAX_OSM_NODEID, 0, WeightData(), false, false,
|
||||
false, false, true, TRAVEL_MODE_INACCESSIBLE, false,
|
||||
return InternalExtractorEdge(MAX_OSM_NODEID,
|
||||
MAX_OSM_NODEID,
|
||||
0,
|
||||
WeightData(),
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
true,
|
||||
TRAVEL_MODE_INACCESSIBLE,
|
||||
false,
|
||||
guidance::RoadClassificationData());
|
||||
}
|
||||
|
||||
|
||||
@@ -27,8 +27,7 @@ struct OriginalEdgeData
|
||||
|
||||
OriginalEdgeData()
|
||||
: via_node(std::numeric_limits<unsigned>::max()),
|
||||
name_id(std::numeric_limits<unsigned>::max()),
|
||||
entry_classid(INVALID_ENTRY_CLASSID),
|
||||
name_id(std::numeric_limits<unsigned>::max()), entry_classid(INVALID_ENTRY_CLASSID),
|
||||
turn_instruction(guidance::TurnInstruction::INVALID()),
|
||||
travel_mode(TRAVEL_MODE_INACCESSIBLE)
|
||||
{
|
||||
|
||||
@@ -11,24 +11,19 @@ namespace extractor
|
||||
struct ProfileProperties
|
||||
{
|
||||
ProfileProperties()
|
||||
: traffic_signal_penalty(0), u_turn_penalty(0), continue_straight_at_waypoint(true), use_turn_restrictions(false)
|
||||
: traffic_signal_penalty(0), u_turn_penalty(0), continue_straight_at_waypoint(true),
|
||||
use_turn_restrictions(false)
|
||||
{
|
||||
}
|
||||
|
||||
double GetUturnPenalty() const
|
||||
{
|
||||
return u_turn_penalty / 10.;
|
||||
}
|
||||
double GetUturnPenalty() const { return u_turn_penalty / 10.; }
|
||||
|
||||
void SetUturnPenalty(const double u_turn_penalty_)
|
||||
{
|
||||
u_turn_penalty = boost::numeric_cast<int>(u_turn_penalty_ * 10.);
|
||||
}
|
||||
|
||||
double GetTrafficSignalPenalty() const
|
||||
{
|
||||
return traffic_signal_penalty / 10.;
|
||||
}
|
||||
double GetTrafficSignalPenalty() const { return traffic_signal_penalty / 10.; }
|
||||
|
||||
void SetTrafficSignalPenalty(const double traffic_signal_penalty_)
|
||||
{
|
||||
|
||||
@@ -36,13 +36,15 @@ struct QueryNode
|
||||
static QueryNode min_value()
|
||||
{
|
||||
return QueryNode(util::FixedLongitude(-180 * COORDINATE_PRECISION),
|
||||
util::FixedLatitude(-90 * COORDINATE_PRECISION), MIN_OSM_NODEID);
|
||||
util::FixedLatitude(-90 * COORDINATE_PRECISION),
|
||||
MIN_OSM_NODEID);
|
||||
}
|
||||
|
||||
static QueryNode max_value()
|
||||
{
|
||||
return QueryNode(util::FixedLongitude(180 * COORDINATE_PRECISION),
|
||||
util::FixedLatitude(90 * COORDINATE_PRECISION), MAX_OSM_NODEID);
|
||||
util::FixedLatitude(90 * COORDINATE_PRECISION),
|
||||
MAX_OSM_NODEID);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
#ifndef RASTER_SOURCE_HPP
|
||||
#define RASTER_SOURCE_HPP
|
||||
|
||||
#include "util/exception.hpp"
|
||||
#include "util/coordinate.hpp"
|
||||
#include "util/exception.hpp"
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/filesystem/fstream.hpp>
|
||||
#include <boost/spirit/include/qi_int.hpp>
|
||||
#include <boost/spirit/include/qi.hpp>
|
||||
#include <boost/algorithm/string/trim.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/filesystem.hpp>
|
||||
#include <boost/filesystem/fstream.hpp>
|
||||
#include <boost/spirit/include/qi.hpp>
|
||||
#include <boost/spirit/include/qi_int.hpp>
|
||||
|
||||
#include <unordered_map>
|
||||
#include <iterator>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
|
||||
@@ -12,8 +12,7 @@ namespace extractor
|
||||
|
||||
struct TurnRestriction
|
||||
{
|
||||
union WayOrNode
|
||||
{
|
||||
union WayOrNode {
|
||||
OSMNodeID_weak node;
|
||||
OSMEdgeID_weak way;
|
||||
};
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace extractor
|
||||
class RestrictionMap
|
||||
{
|
||||
public:
|
||||
RestrictionMap() : m_count(0){}
|
||||
RestrictionMap() : m_count(0) {}
|
||||
RestrictionMap(const std::vector<TurnRestriction> &restriction_list);
|
||||
|
||||
// Replace end v with w in each turn restriction containing u as via node
|
||||
|
||||
@@ -42,7 +42,7 @@ struct ProfileProperties;
|
||||
class RestrictionParser
|
||||
{
|
||||
public:
|
||||
RestrictionParser(lua_State *lua_state, const ProfileProperties& properties);
|
||||
RestrictionParser(lua_State *lua_state, const ProfileProperties &properties);
|
||||
boost::optional<InputRestrictionContainer> TryParse(const osmium::Relation &relation) const;
|
||||
|
||||
private:
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
|
||||
#include "util/lua_util.hpp"
|
||||
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
#include <tbb/enumerable_thread_specific.h>
|
||||
|
||||
struct lua_State;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#ifndef TARJAN_SCC_HPP
|
||||
#define TARJAN_SCC_HPP
|
||||
|
||||
#include "util/typedefs.hpp"
|
||||
#include "util/deallocating_vector.hpp"
|
||||
#include "extractor/node_based_edge.hpp"
|
||||
#include "extractor/query_node.hpp"
|
||||
#include "util/deallocating_vector.hpp"
|
||||
#include "util/percent.hpp"
|
||||
#include "util/typedefs.hpp"
|
||||
|
||||
#include "util/integer_range.hpp"
|
||||
#include "util/simple_logger.hpp"
|
||||
@@ -16,9 +16,9 @@
|
||||
#include <boost/assert.hpp>
|
||||
#include <cstdint>
|
||||
|
||||
#include <memory>
|
||||
#include <algorithm>
|
||||
#include <climits>
|
||||
#include <memory>
|
||||
#include <stack>
|
||||
#include <vector>
|
||||
|
||||
@@ -160,11 +160,9 @@ template <typename GraphT> class TarjanSCC
|
||||
TIMER_STOP(SCC_RUN);
|
||||
util::SimpleLogger().Write() << "SCC run took: " << TIMER_MSEC(SCC_RUN) / 1000. << "s";
|
||||
|
||||
size_one_counter = std::count_if(component_size_vector.begin(), component_size_vector.end(),
|
||||
[](unsigned value)
|
||||
{
|
||||
return 1 == value;
|
||||
});
|
||||
size_one_counter = std::count_if(component_size_vector.begin(),
|
||||
component_size_vector.end(),
|
||||
[](unsigned value) { return 1 == value; });
|
||||
}
|
||||
|
||||
std::size_t GetNumberOfComponents() const { return component_size_vector.size(); }
|
||||
|
||||
Reference in New Issue
Block a user