Allow multiple GeoJSON files

This commit is contained in:
Michael Krasnyk
2017-08-18 15:27:49 +02:00
parent fb02a4c674
commit fc39e0ce1a
7 changed files with 22 additions and 10 deletions
+1 -1
View File
@@ -79,7 +79,7 @@ struct ExtractorConfig final : storage::IOConfig
boost::filesystem::path input_path;
boost::filesystem::path profile_path;
boost::filesystem::path location_dependent_data_path;
std::vector<boost::filesystem::path> location_dependent_data_paths;
unsigned requested_num_threads;
unsigned small_component_size;
@@ -30,11 +30,13 @@ struct LocationDependentData
using property_t = boost::variant<boost::blank, double, std::string, bool>;
using properties_t = std::unordered_map<std::string, property_t>;
LocationDependentData(const boost::filesystem::path &file_path);
LocationDependentData(const std::vector<boost::filesystem::path> &file_paths);
sol::table operator()(sol::state &state, const osmium::Way &way) const;
private:
void loadLocationDependentData(const boost::filesystem::path &file_path);
rtree_t rtree;
std::vector<std::pair<polygon_t, properties_t>> polygons;
};
@@ -68,8 +68,9 @@ class Sol2ScriptingEnvironment final : public ScriptingEnvironment
static const constexpr int SUPPORTED_MIN_API_VERSION = 0;
static const constexpr int SUPPORTED_MAX_API_VERSION = 3;
explicit Sol2ScriptingEnvironment(const std::string &file_name,
const boost::filesystem::path &location_dependent_data_path);
explicit Sol2ScriptingEnvironment(
const std::string &file_name,
const std::vector<boost::filesystem::path> &location_dependent_data_paths);
~Sol2ScriptingEnvironment() override = default;
const ProfileProperties &GetProfileProperties() override;