On 11/9/20 12:46 AM, Nyall Dawson wrote: > But more generally, I'd say you don't need any external library here. > Basically the library is just doing a point in polygon lookup against > the reference boundaries, and that's something which QGIS is already > awesome at ;) I'd suggest you just: > 1. find the format which gives smallest file size for the time zone boundaries > 2. include this in your plugin > 3. use native classes classes to read these boundaries and use > QgsFeatureRequest to do the point in polygon lookups.
+1 ! Thanks Nyall, for making this clear (to me). If we either create a new geopackage with timezones (geoms) in it and put it: https://github.com/qgis/QGIS/tree/master/resources/data OR add it to current world_map.gpkg, you can use the 'inbuilt:' uri to get to the data (iface.addVectorLayer('inbuilt:/data/world_map.gpkg', 'Countries', 'ogr')) to (reverse) lookup timezones. Then use Qt's Datetime to handle the actual date/time-stuff. (What we do not tackle now is that QGIS itself does not handle this deep inside yet) Regards, Richard Duivenvoorde _______________________________________________ QGIS-Developer mailing list [email protected] List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
