[osm] adding admin1 ids to the OSM country rtree

This commit is contained in:
Al
2016-10-04 23:12:15 -04:00
parent 2bc109f519
commit 6081df0cd1
2 changed files with 7 additions and 1 deletions

View File

@@ -14,8 +14,10 @@ from collections import defaultdict, OrderedDict
from itertools import izip, combinations
from geodata.coordinates.conversion import latlon_to_decimal
from geodata.encoding import safe_encode, safe_decode
from geodata.file_utils import ensure_dir
from geodata.graph.scc import strongly_connected_components
from geodata.i18n.languages import osm_admin1_ids
from geodata.math.floats import isclose
from geodata.osm.extract import *
@@ -312,7 +314,7 @@ class OSMBuildingPolygonReader(OSMPolygonReader):
class OSMCountryPolygonReader(OSMPolygonReader):
def include_polygon(self, props):
return 'ISO3166-1:alpha2' in props
return 'ISO3166-1:alpha2' in props or (props.get('type', 'relation'), safe_encode(props.get('id', ''))) in osm_admin1_ids
class OSMPostalCodesPolygonReader(OSMPolygonReader):