Add location_dependent_data unit tests

This commit is contained in:
Michael Krasnyk
2017-08-30 22:11:26 +02:00
parent 4eac861eae
commit b15288e0ea
5 changed files with 186 additions and 37 deletions
@@ -7,8 +7,6 @@
#include <osmium/osm/way.hpp>
#include <sol2/sol.hpp>
#include <string>
#include <unordered_map>
@@ -30,9 +28,15 @@ 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 &path);
LocationDependentData(const std::vector<boost::filesystem::path> &file_paths);
sol::table operator()(sol::state &state, const osmium::Way &way) const;
bool empty() const { return rtree.empty(); }
properties_t operator()(const point_t &point) const;
properties_t operator()(const osmium::Way &way) const;
private:
void loadLocationDependentData(const boost::filesystem::path &file_path);