[osm] adding admin1 ids to the OSM country rtree
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user