[osm/polygons] Using an LRU cache for prepped polygons in the various PolygonIndex subclasses. That way can store less simplified polygons but keep frequently accessed ones (like countries) in memory
This commit is contained in:
@@ -434,6 +434,9 @@ class QuattroshapesReverseGeocoder(RTreePolygonIndex):
|
||||
|
||||
PRIORITIES_FILENAME = 'priorities.json'
|
||||
|
||||
persistent_polygons = True
|
||||
cache_size = 100000
|
||||
|
||||
sorted_levels = (COUNTRY,
|
||||
ADMIN1_REGION,
|
||||
ADMIN1,
|
||||
@@ -648,6 +651,9 @@ class OSMReverseGeocoder(RTreePolygonIndex):
|
||||
|
||||
polygon_reader = OSMAdminPolygonReader
|
||||
|
||||
persistent_polygons = True
|
||||
cache_size = 100000
|
||||
|
||||
include_property_patterns = set([
|
||||
'name',
|
||||
'name:*',
|
||||
@@ -794,11 +800,15 @@ class OSMReverseGeocoder(RTreePolygonIndex):
|
||||
|
||||
|
||||
class OSMSubdivisionReverseGeocoder(OSMReverseGeocoder):
|
||||
persistent_polygons = True
|
||||
cache_size = 10000
|
||||
polygon_reader = OSMSubdivisionPolygonReader
|
||||
include_property_patterns = OSMReverseGeocoder.include_property_patterns | set(['landuse'])
|
||||
|
||||
|
||||
class OSMBuildingReverseGeocoder(OSMReverseGeocoder):
|
||||
persistent_polygons = True
|
||||
cache_size = 10000
|
||||
polygon_reader = OSMBuildingPolygonReader
|
||||
include_property_patterns = OSMReverseGeocoder.include_property_patterns | set(['building', 'building:levels'])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user