Remove CheckCompability because it now duplicates logic in the datafacade
This commit is contained in:
committed by
Patrick Niklaus
parent
c334d11e95
commit
24e0028afb
+4
-23
@@ -1,4 +1,5 @@
|
||||
#include "osrm/osrm.hpp"
|
||||
|
||||
#include "engine/algorithm.hpp"
|
||||
#include "engine/api/match_parameters.hpp"
|
||||
#include "engine/api/nearest_parameters.hpp"
|
||||
@@ -37,30 +38,10 @@ OSRM::OSRM(engine::EngineConfig &config)
|
||||
// Now, check that the algorithm requested can be used with the data
|
||||
// that's available.
|
||||
|
||||
if (config.algorithm == EngineConfig::Algorithm::CH ||
|
||||
config.algorithm == EngineConfig::Algorithm::CoreCH)
|
||||
if (config.algorithm == EngineConfig::Algorithm::CoreCH)
|
||||
{
|
||||
if (config.algorithm == EngineConfig::Algorithm::CoreCH)
|
||||
{
|
||||
util::Log(logWARNING) << "Using CoreCH is deprecated. Falling back to CH";
|
||||
config.algorithm = EngineConfig::Algorithm::CH;
|
||||
}
|
||||
bool ch_compatible = engine::Engine<CH>::CheckCompatibility(config);
|
||||
|
||||
// throw error if dataset is not usable with CH
|
||||
if (config.algorithm == EngineConfig::Algorithm::CH && !ch_compatible)
|
||||
{
|
||||
throw util::exception("Dataset is not compatible with CH");
|
||||
}
|
||||
}
|
||||
else if (config.algorithm == EngineConfig::Algorithm::MLD)
|
||||
{
|
||||
bool mld_compatible = engine::Engine<MLD>::CheckCompatibility(config);
|
||||
// throw error if dataset is not usable with MLD
|
||||
if (!mld_compatible)
|
||||
{
|
||||
throw util::exception("Dataset is not compatible with MLD.");
|
||||
}
|
||||
util::Log(logWARNING) << "Using CoreCH is deprecated. Falling back to CH";
|
||||
config.algorithm = EngineConfig::Algorithm::CH;
|
||||
}
|
||||
|
||||
switch (config.algorithm)
|
||||
|
||||
@@ -89,8 +89,6 @@ inline void readBlocks(const boost::filesystem::path &path, DataLayout &layout)
|
||||
}
|
||||
}
|
||||
|
||||
static constexpr std::size_t NUM_METRICS = 8;
|
||||
|
||||
using RTreeLeaf = engine::datafacade::BaseDataFacade::RTreeLeaf;
|
||||
using RTreeNode = util::StaticRTree<RTreeLeaf, storage::Ownership::View>::TreeNode;
|
||||
using QueryGraph = util::StaticGraph<contractor::QueryEdge::EdgeData>;
|
||||
|
||||
Reference in New Issue
Block a user