Allow multiple GeoJSON files
This commit is contained in:
@@ -18,7 +18,15 @@ namespace osrm
|
||||
namespace extractor
|
||||
{
|
||||
|
||||
LocationDependentData::LocationDependentData(const boost::filesystem::path &file_path)
|
||||
LocationDependentData::LocationDependentData(const std::vector<boost::filesystem::path> &file_paths)
|
||||
{
|
||||
for (const auto &path : file_paths)
|
||||
{
|
||||
loadLocationDependentData(path);
|
||||
}
|
||||
}
|
||||
|
||||
void LocationDependentData::loadLocationDependentData(const boost::filesystem::path &file_path)
|
||||
{
|
||||
if (file_path.empty())
|
||||
return;
|
||||
|
||||
@@ -81,8 +81,9 @@ template <class T> double lonToDouble(T const &object)
|
||||
}
|
||||
|
||||
Sol2ScriptingEnvironment::Sol2ScriptingEnvironment(
|
||||
const std::string &file_name, const boost::filesystem::path &location_dependent_data_path)
|
||||
: file_name(file_name), location_dependent_data(location_dependent_data_path)
|
||||
const std::string &file_name,
|
||||
const std::vector<boost::filesystem::path> &location_dependent_data_paths)
|
||||
: file_name(file_name), location_dependent_data(location_dependent_data_paths)
|
||||
{
|
||||
util::Log() << "Using script " << file_name;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace osrm
|
||||
void extract(const extractor::ExtractorConfig &config)
|
||||
{
|
||||
extractor::Sol2ScriptingEnvironment scripting_environment(config.profile_path.string(),
|
||||
config.location_dependent_data_path);
|
||||
config.location_dependent_data_paths);
|
||||
extractor::Extractor(config).run(scripting_environment);
|
||||
}
|
||||
|
||||
|
||||
@@ -63,8 +63,8 @@ return_code parseArguments(int argc,
|
||||
->default_value(false),
|
||||
"Save conditional restrictions found during extraction to disk for use "
|
||||
"during contraction")("location-dependent-data",
|
||||
boost::program_options::value<boost::filesystem::path>(
|
||||
&extractor_config.location_dependent_data_path)
|
||||
boost::program_options::value<std::vector<boost::filesystem::path>>(
|
||||
&extractor_config.location_dependent_data_paths)
|
||||
->composing(),
|
||||
"GeoJSON files with location-dependent data");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user