From 1658c425c5b875a84a73f6c12c1d141606e112ce Mon Sep 17 00:00:00 2001 From: Al Date: Sun, 23 Oct 2016 00:57:52 -0400 Subject: [PATCH] [fix] clear country cache only at each new country, not each file --- scripts/geodata/openaddresses/formatter.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/geodata/openaddresses/formatter.py b/scripts/geodata/openaddresses/formatter.py index 23e39723..17583eed 100644 --- a/scripts/geodata/openaddresses/formatter.py +++ b/scripts/geodata/openaddresses/formatter.py @@ -258,7 +258,6 @@ class OpenAddressesFormatter(object): # Clear cached polygons self.components.osm_admin_rtree.clear_cache() self.components.neighborhoods_rtree.clear_cache() - self.country_rtree.clear_cache() for row in reader: try: @@ -488,6 +487,9 @@ class OpenAddressesFormatter(object): i = 0 for country_dir, country_config in six.iteritems(openaddresses_config.country_configs): + # Clear country cache for each new country + self.country_rtree.clear_cache() + for file_config in country_config.get('files', []): filename = file_config['filename']