[openaddresses] adding clear_cache method to clear the LRU cache for point-in-polygon indices and using it in OpenAddresses import since it heavily reuses polygons and only for the current file

This commit is contained in:
Al
2016-10-22 20:28:59 -04:00
parent d51a1d6196
commit 63edd53fb3
2 changed files with 10 additions and 0 deletions

View File

@@ -255,6 +255,9 @@ class OpenAddressesFormatter(object):
latitude_index = headers.index('LAT')
longitude_index = headers.index('LON')
# Clear cached polygons
self.components.osm_admin_rtree.clear_cache()
for row in reader:
try:
latitude = float(row[latitude_index])