#ifndef OSRM_LOCATION_DEPENDENT_DATA_HPP #define OSRM_LOCATION_DEPENDENT_DATA_HPP #include #include #include #include #include #include #include namespace osrm { namespace extractor { struct LocationDependentData { using point_t = boost::geometry::model::d2:: point_xy>; using segment_t = boost::geometry::model::segment; using polygon_t = boost::geometry::model::polygon; using polygon_bands_t = std::vector>; using box_t = boost::geometry::model::box; using polygon_position_t = std::size_t; using rtree_t = boost::geometry::index::rtree, boost::geometry::index::rstar<8>>; using property_t = boost::variant; using properties_t = std::unordered_map; LocationDependentData(const std::vector &file_paths); bool empty() const { return rtree.empty(); } std::vector GetPropertyIndexes(const point_t &point) const; property_t FindByKey(const std::vector &property_indexes, const char *key) const; private: void loadLocationDependentData(const boost::filesystem::path &file_path, std::vector &bounding_boxes); rtree_t rtree; std::vector> polygons; std::vector properties; }; } } #endif