From cb3fe5273ac635c5ba6cba917bf32140f2fcc762 Mon Sep 17 00:00:00 2001 From: Al Date: Wed, 7 Sep 2016 11:49:39 -0400 Subject: [PATCH] [components] using gnis:class=Populated Place to map to city for the US when admin_level is not specified and the place key is not specified/not mapped --- scripts/geodata/osm/components.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/geodata/osm/components.py b/scripts/geodata/osm/components.py index e9afb76c..a2e09629 100644 --- a/scripts/geodata/osm/components.py +++ b/scripts/geodata/osm/components.py @@ -56,6 +56,9 @@ class OSMAddressComponents(object): 'province': AddressFormatter.STATE, 'district': AddressFormatter.STATE_DISTRICT, 'county': AddressFormatter.STATE_DISTRICT, + }, + 'gnis:class': { + 'populated place': AddressFormatter.CITY, } } @@ -134,7 +137,7 @@ class OSMAddressComponents(object): config = override_config break - values = [(k, v) for k, v in six.iteritems(properties) if isinstance(v, collections.Hashable)] + values = [(k.lower(), v.lower()) for k, v in six.iteritems(properties) if isinstance(v, six.string_types)] # place=city, place=suburb, etc. override per-country boundaries if not config.get('no_global_overrides', False):