[neighborhoods] check if there's no defined place-type before classifying a polygon as city_district

This commit is contained in:
Al
2016-12-11 02:44:02 -05:00
parent 01d6bc27b6
commit e8abf44c16

View File

@@ -962,7 +962,7 @@ class AddressComponents(object):
key, raw_key = self.pick_random_name_key(neighborhood, neighborhood_level, suffix=language_suffix) key, raw_key = self.pick_random_name_key(neighborhood, neighborhood_level, suffix=language_suffix)
name = neighborhood.get(key, neighborhood.get(raw_key)) name = neighborhood.get(key, neighborhood.get(raw_key))
if place_type == 'borough' or polygon_type == 'local_admin': if place_type == 'borough' or (not place and polygon_type == 'local_admin'):
neighborhood_level = AddressFormatter.CITY_DISTRICT neighborhood_level = AddressFormatter.CITY_DISTRICT
# Optimization so we don't use e.g. Brooklyn multiple times # Optimization so we don't use e.g. Brooklyn multiple times