Remove CheckCompability because it now duplicates logic in the datafacade

This commit is contained in:
Patrick Niklaus
2018-03-28 11:27:07 +00:00
committed by Patrick Niklaus
parent c334d11e95
commit 24e0028afb
3 changed files with 4 additions and 112 deletions
+4 -23
View File
@@ -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)
-2
View File
@@ -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>;