#ifndef OSRM_TIMEZONES_HPP #define OSRM_TIMEZONES_HPP #include "util/log.hpp" #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; bool SupportsShapefiles(); class Timezoner { public: Timezoner() = default; Timezoner(std::string tz_filename, std::time_t utc_time_now); struct tm operator()(const point_t &point) const; private: void LoadLocalTimesRTree(const std::string &tz_shapes_filename, std::time_t utc_time); struct tm default_time; rtree_t rtree; std::vector local_times; }; } } #endif