Currently OSRM only supports turn restrictions with a single via-node or one via-way. OSM allows for multiple via-ways to represent longer and more complex restrictions. This PR extends the use of duplicate nodes for representng via-way turn restrictions to also support multi via-way restrictions. Effectively, this increases the edge-based graph size by the number of edges in multi via-way restrictions. However, given the low number of these restrictions it has little effect on total graph size. In addition, we add a new step in the extraction phase that constructs a restriction graph to support more complex relationships between restrictions, such as nested restrictions and overlapping restrictions.
45 lines
1.3 KiB
C++
45 lines
1.3 KiB
C++
#ifndef GEOMETRY_COMPRESSOR_HPP
|
|
#define GEOMETRY_COMPRESSOR_HPP
|
|
|
|
#include "extractor/scripting_environment.hpp"
|
|
#include "util/typedefs.hpp"
|
|
|
|
#include "extractor/maneuver_override.hpp"
|
|
#include "util/node_based_graph.hpp"
|
|
|
|
#include <memory>
|
|
#include <unordered_set>
|
|
#include <vector>
|
|
|
|
namespace osrm
|
|
{
|
|
namespace extractor
|
|
{
|
|
|
|
class CompressedEdgeContainer;
|
|
struct TurnRestriction;
|
|
|
|
class GraphCompressor
|
|
{
|
|
using EdgeData = util::NodeBasedDynamicGraph::EdgeData;
|
|
|
|
public:
|
|
void Compress(const std::unordered_set<NodeID> &barrier_nodes,
|
|
const std::unordered_set<NodeID> &traffic_lights,
|
|
ScriptingEnvironment &scripting_environment,
|
|
std::vector<TurnRestriction> &turn_restrictions,
|
|
std::vector<UnresolvedManeuverOverride> &maneuver_overrides,
|
|
util::NodeBasedDynamicGraph &graph,
|
|
const std::vector<NodeBasedEdgeAnnotation> &node_data_container,
|
|
CompressedEdgeContainer &geometry_compressor);
|
|
|
|
private:
|
|
void PrintStatistics(unsigned original_number_of_nodes,
|
|
unsigned original_number_of_edges,
|
|
const util::NodeBasedDynamicGraph &graph) const;
|
|
};
|
|
} // namespace extractor
|
|
} // namespace osrm
|
|
|
|
#endif
|