<div dir="ltr">I need the ability to do a fast time zone lookup in QGIS and found the popular timezonefinder library which I encorported into the Date/Time Tools plugin. See<div><br></div><div><a href="https://github.com/NationalSecurityAgency/qgis-datetimetools-plugin/releases/tag/3.0.1" target="_blank">https://github.com/NationalSecurityAgency/qgis-datetimetools-plugin/releases/tag/3.0.1</a><br></div><div><br></div><div>Rather than using this, Nyall suggested that I just use the original polygon data set and do a point in polygon lookup. So I have done some testing on a 10,000 random point data set where I was looking up the timezone of each point.</div><div><br></div><div>Time results for 10,000 points</div><div>Using timezonefinder: 44 seconds</div><div><br></div><div>Using the algorithm Vector->Geoprocessing Tools->Intersection: 4 minutes, 4 seconds<br></div><div><br></div><div>I also tried iterating over each of the 10,000 points then testing each of the time zone polygons to see if the point feature was contained in it using this statement. It returned once it found a match.</div><div><br></div><div>polyfeature.geometry().contains(point_feature) </div><div><br></div><div>This was definitely not the way to do it and I killed qgis before it finished.</div><div><br></div><div>My conclusion is that timezonefinder has been optimized for very fast lookups. I'm sure there is probably a better way for me to work with a point in polygon lookup and if anyone has any further suggestions let me know. I can see games I could play such as first testing the bounding box or setting up lookup tables, but that is what timezonefinder does so for now that is what I will use.</div><div><br></div><div>If I have missed some fast point in polygon lookup up in the QGIS API please let me know.</div><div><br></div><div>Thanks,</div><div><br></div><div>Calvin</div><div><br></div></div>