From d10d1d35afc2cb9348955f059c0cf7a1fb023955 Mon Sep 17 00:00:00 2001 From: Matt Amos Date: Wed, 13 Dec 2017 16:16:18 +0000 Subject: [PATCH] Include all name variants. Previous behaviour was to de-duplicate name variants with the same value as the main name tag. However, that breaks name fall-back logic when one doesn't want to fall back to the main name. For example, something tagged with `name=Foo, name:A=Foo, name:B=Bar` would remove the `name:A` tag, meaning that if the name preference display was `A` then `B` then local, it would display `Bar` instead of `Foo`. --- integration-test/1406-include-all-name-variants.py | 14 ++++++++++++++ integration-test/418-wof-l10n_name.py | 2 +- vectordatasource/transform.py | 2 -- 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 integration-test/1406-include-all-name-variants.py diff --git a/integration-test/1406-include-all-name-variants.py b/integration-test/1406-include-all-name-variants.py new file mode 100644 index 000000000..8b0c5ade6 --- /dev/null +++ b/integration-test/1406-include-all-name-variants.py @@ -0,0 +1,14 @@ +from . import FixtureTest + + +class IncludeAllNameVariants(FixtureTest): + + def test_duplicate_names(self): + self.load_fixtures([ + 'http://www.openstreetmap.org/node/206270454', + ]) + + self.assert_has_feature( + 15, 18199, 11103, 'pois', + {'id': 206270454, 'kind': 'station', + 'name': None, 'name:pl': None}) diff --git a/integration-test/418-wof-l10n_name.py b/integration-test/418-wof-l10n_name.py index 1871e56b2..44285cf32 100644 --- a/integration-test/418-wof-l10n_name.py +++ b/integration-test/418-wof-l10n_name.py @@ -26,7 +26,7 @@ def test_san_francisco_wof(self): {'id': 85882641, 'kind': 'neighbourhood', 'source': "whosonfirst.mapzen.com", 'name': 'San Francisco', - 'name:es': type(None)}) + 'name:es': 'San Francisco'}) def test_san_francisco_osm(self): # San Francisco (osm city) diff --git a/vectordatasource/transform.py b/vectordatasource/transform.py index 56f43d8d5..f5d155f1e 100644 --- a/vectordatasource/transform.py +++ b/vectordatasource/transform.py @@ -469,8 +469,6 @@ def tags_name_i18n(shape, properties, fid, zoom): langs = {} for k, v in tags.items(): - if v == name: - continue for candidate in alt_name_prefix_candidates: if k.startswith(candidate):