Optimise path distance calculation in MLD map matching (#6876)
This commit is contained in:
parent
1e2ffee97c
commit
ee8e0f890a
3
.github/workflows/osrm-backend.yml
vendored
3
.github/workflows/osrm-backend.yml
vendored
@ -518,7 +518,8 @@ jobs:
|
|||||||
make --jobs=${JOBS} benchmarks
|
make --jobs=${JOBS} benchmarks
|
||||||
./src/benchmarks/alias-bench
|
./src/benchmarks/alias-bench
|
||||||
./src/benchmarks/json-render-bench ../src/benchmarks/portugal_to_korea.json
|
./src/benchmarks/json-render-bench ../src/benchmarks/portugal_to_korea.json
|
||||||
./src/benchmarks/match-bench ../test/data/ch/monaco.osrm
|
./src/benchmarks/match-bench ../test/data/ch/monaco.osrm ch
|
||||||
|
./src/benchmarks/match-bench ../test/data/mld/monaco.osrm mld
|
||||||
./src/benchmarks/packedvector-bench
|
./src/benchmarks/packedvector-bench
|
||||||
./src/benchmarks/rtree-bench ../test/data/monaco.osrm.ramIndex ../test/data/monaco.osrm.fileIndex ../test/data/monaco.osrm.nbg_nodes
|
./src/benchmarks/rtree-bench ../test/data/monaco.osrm.ramIndex ../test/data/monaco.osrm.fileIndex ../test/data/monaco.osrm.nbg_nodes
|
||||||
popd
|
popd
|
||||||
|
@ -47,6 +47,8 @@
|
|||||||
- FIXED: Fix bug when searching for maneuver overrides [#6739](https://github.com/Project-OSRM/osrm-backend/pull/6739)
|
- FIXED: Fix bug when searching for maneuver overrides [#6739](https://github.com/Project-OSRM/osrm-backend/pull/6739)
|
||||||
- FIXED: Remove force-loop checks for routes with u-turns [#6858](https://github.com/Project-OSRM/osrm-backend/pull/6858)
|
- FIXED: Remove force-loop checks for routes with u-turns [#6858](https://github.com/Project-OSRM/osrm-backend/pull/6858)
|
||||||
- FIXED: Correctly check runtime search conditions for forcing routing steps [#6866](https://github.com/Project-OSRM/osrm-backend/pull/6866)
|
- FIXED: Correctly check runtime search conditions for forcing routing steps [#6866](https://github.com/Project-OSRM/osrm-backend/pull/6866)
|
||||||
|
- Map Matching:
|
||||||
|
- CHANGED: Optimise path distance calculation in MLD map matching. [#6876](https://github.com/Project-OSRM/osrm-backend/pull/6876)
|
||||||
- Debug tiles:
|
- Debug tiles:
|
||||||
- FIXED: Ensure speed layer features have unique ids. [#6726](https://github.com/Project-OSRM/osrm-backend/pull/6726)
|
- FIXED: Ensure speed layer features have unique ids. [#6726](https://github.com/Project-OSRM/osrm-backend/pull/6726)
|
||||||
|
|
||||||
|
@ -613,11 +613,38 @@ double getNetworkDistance(SearchEngineData<Algorithm> &engine_working_data,
|
|||||||
return std::numeric_limits<double>::max();
|
return std::numeric_limits<double>::max();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<PathData> unpacked_path;
|
BOOST_ASSERT(unpacked_nodes.size() >= 1);
|
||||||
|
|
||||||
annotatePath(facade, endpoints, unpacked_nodes, unpacked_edges, unpacked_path);
|
EdgeDistance distance = {0.0};
|
||||||
|
|
||||||
return getPathDistance(facade, unpacked_path, source_phantom, target_phantom);
|
if (source_phantom.forward_segment_id.id == unpacked_nodes.front())
|
||||||
|
{
|
||||||
|
BOOST_ASSERT(source_phantom.forward_segment_id.enabled);
|
||||||
|
distance = EdgeDistance{0} - source_phantom.GetForwardDistance();
|
||||||
|
}
|
||||||
|
else if (source_phantom.reverse_segment_id.id == unpacked_nodes.front())
|
||||||
|
{
|
||||||
|
BOOST_ASSERT(source_phantom.reverse_segment_id.enabled);
|
||||||
|
distance = EdgeDistance{0} - source_phantom.GetReverseDistance();
|
||||||
|
}
|
||||||
|
|
||||||
|
for (size_t index = 0; index < unpacked_nodes.size() - 1; ++index)
|
||||||
|
{
|
||||||
|
distance += facade.GetNodeDistance(unpacked_nodes[index]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (target_phantom.forward_segment_id.id == unpacked_nodes.back())
|
||||||
|
{
|
||||||
|
BOOST_ASSERT(target_phantom.forward_segment_id.enabled);
|
||||||
|
distance += target_phantom.GetForwardDistance();
|
||||||
|
}
|
||||||
|
else if (target_phantom.reverse_segment_id.id == unpacked_nodes.back())
|
||||||
|
{
|
||||||
|
BOOST_ASSERT(target_phantom.reverse_segment_id.enabled);
|
||||||
|
distance += target_phantom.GetReverseDistance();
|
||||||
|
}
|
||||||
|
|
||||||
|
return from_alias<double>(distance);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace osrm::engine::routing_algorithms::mld
|
} // namespace osrm::engine::routing_algorithms::mld
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#include "engine/engine_config.hpp"
|
||||||
#include "util/timing_util.hpp"
|
#include "util/timing_util.hpp"
|
||||||
|
|
||||||
#include "osrm/match_parameters.hpp"
|
#include "osrm/match_parameters.hpp"
|
||||||
@ -32,6 +33,8 @@ try
|
|||||||
// Configure based on a .osrm base path, and no datasets in shared mem from osrm-datastore
|
// Configure based on a .osrm base path, and no datasets in shared mem from osrm-datastore
|
||||||
EngineConfig config;
|
EngineConfig config;
|
||||||
config.storage_config = {argv[1]};
|
config.storage_config = {argv[1]};
|
||||||
|
config.algorithm = (argc > 2 && std::string{argv[2]} == "mld") ? EngineConfig::Algorithm::MLD
|
||||||
|
: EngineConfig::Algorithm::CH;
|
||||||
config.use_shared_memory = false;
|
config.use_shared_memory = false;
|
||||||
|
|
||||||
// Routing machine with several services (such as Route, Table, Nearest, Trip, Match)
|
// Routing machine with several services (such as Route, Table, Nearest, Trip, Match)
|
||||||
|
Loading…
Reference in New Issue
Block a user