From 826cbc7f24ecc2ca572ef9d2ba7600b60e30f992 Mon Sep 17 00:00:00 2001 From: Al Date: Sat, 24 Dec 2016 20:21:25 -0500 Subject: [PATCH] [addresses/JP] more checks for matching major/minor neighborhood polygons with nodes in Japan --- scripts/geodata/addresses/components.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/geodata/addresses/components.py b/scripts/geodata/addresses/components.py index 3a7d3de7..396e6969 100644 --- a/scripts/geodata/addresses/components.py +++ b/scripts/geodata/addresses/components.py @@ -863,7 +863,11 @@ class AddressComponents(object): if is_japan and component == AddressFormatter.SUBURB and not first_suburb: existing = grouped_components[component] for p in existing: - if (props['id'] == p['id'] and props['type'] == p['type']) or ('place' in p and 'place' in props and props['place'] == p['place']) or ('name' in props and name in 'p' and props['name'] == p['name']): + if (props['id'] == p['id'] and props['type'] == p['type']) or \ + (props.get('place') in ('neighbourhood', 'neighborhood') and p.get('admin_level') == '10') or \ + (props.get('place') == 'quarter' and p.get('admin_level') == '9') or \ + ('place' in p and 'place' in props and props['place'] == p['place']) or \ + ('name' in props and name in 'p' and props['name'] == p['name']): break else: grouped_components[component].append(props)