This change unblocks the osrm-extract debug build, which is currently failing on a maneuver override assertion. The processing of maneuver overrides currently has three issues - It assumes the via node(s) can't be compressed (the failing assertion) - It can't handle via-paths containing incompressible nodes - It doesn't interop with turn restriction on the same path Turn restrictions and maneuver overrides both use the same from-via-to path representation. Therefore, we can fix these issues by consolidating their structures and reusing the path representation for turn restrictions, which already is robust to the above issues. This also simplifies some of the codebase by removing maneuver override specific path processing. There are ~100 maneuver overrides in the OSM database, so the impact on processing and routing will be minimal.
45 lines
1.2 KiB
C++
45 lines
1.2 KiB
C++
#ifndef GEOMETRY_COMPRESSOR_HPP
|
|
#define GEOMETRY_COMPRESSOR_HPP
|
|
|
|
#include "extractor/scripting_environment.hpp"
|
|
#include "util/typedefs.hpp"
|
|
|
|
#include "util/node_based_graph.hpp"
|
|
|
|
#include <memory>
|
|
#include <unordered_set>
|
|
#include <vector>
|
|
|
|
namespace osrm
|
|
{
|
|
namespace extractor
|
|
{
|
|
|
|
class CompressedEdgeContainer;
|
|
struct TurnRestriction;
|
|
struct UnresolvedManeuverOverride;
|
|
|
|
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
|