#ifndef OSRM_TIMEZONES_HPP #define OSRM_TIMEZONES_HPP #include "util/log.hpp" #include #include #include #include #include #include namespace osrm { namespace updater { // Time zone shape polygons loaded in R-tree // local_time_t is a pair of a time zone shape polygon and the corresponding local time // rtree_t is a lookup R-tree that maps a geographic point to an index in a local_time_t vector using point_t = boost::geometry::model:: point>; using polygon_t = boost::geometry::model::polygon; using box_t = boost::geometry::model::box; using rtree_t = boost::geometry::index::rtree, boost::geometry::index::rstar<8>>; using local_time_t = std::pair; class Timezoner { public: Timezoner() = default; Timezoner(const char geojson[], std::time_t utc_time_now); Timezoner(const boost::filesystem::path &tz_shapes_filename, std::time_t utc_time_now); boost::optional operator()(const point_t &point) const; private: void LoadLocalTimesRTree(rapidjson::Document &geojson, std::time_t utc_time); rtree_t rtree; std::vector local_times; }; } } #endif