[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

This commit is contained in:
Al
2016-09-07 11:49:39 -04:00
parent 88be23c85b
commit cb3fe5273a

View File

@@ -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):