From b51e37259269c83230595f2a939dd77aa2f05a25 Mon Sep 17 00:00:00 2001 From: Travis Grigsby Date: Wed, 4 May 2022 16:48:12 -0700 Subject: [PATCH] adding TLC POV to NE export, YAML files and transform.py (#2081) --- queries/ne.jinja2 | 2 +- vectordatasource/transform.py | 14 +++++++------- yaml/boundaries.yaml | 1 + yaml/places.yaml | 2 ++ 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/queries/ne.jinja2 b/queries/ne.jinja2 index 753ebadf0..f9f49e562 100644 --- a/queries/ne.jinja2 +++ b/queries/ne.jinja2 @@ -1,5 +1,5 @@ {% set ne_languages = ['ar', 'bn', 'de', 'el', 'en', 'es', 'fa', 'fr', 'he', 'hi', 'hu', 'id', 'it', 'ja', 'ko', 'nl', 'pl', 'pt', 'ru', 'sv', 'tr', 'uk', 'ur', 'vi', 'zh', 'zht'] %} -{% set ne_viewpoints = ['iso', 'ar', 'bd', 'br', 'cn', 'de', 'eg', 'es', 'fr', 'gb', 'gr', 'id', 'il', 'in', 'it', 'jp', 'ko', 'ma', 'nl', 'np', 'pk', 'pl', 'ps', 'pt', 'ru', 'sa', 'se', 'tr', 'tw', 'ua', 'us', 'vn'] %} +{% set ne_viewpoints = ['iso', 'tlc', 'ar', 'bd', 'br', 'cn', 'de', 'eg', 'es', 'fr', 'gb', 'gr', 'id', 'il', 'in', 'it', 'jp', 'ko', 'ma', 'nl', 'np', 'pk', 'pl', 'ps', 'pt', 'ru', 'sa', 'se', 'tr', 'tw', 'ua', 'us', 'vn'] %} {% macro ne_common_properties() %} diff --git a/vectordatasource/transform.py b/vectordatasource/transform.py index 623d7ce47..bb4ecece1 100644 --- a/vectordatasource/transform.py +++ b/vectordatasource/transform.py @@ -7,6 +7,12 @@ from math import ceil from numbers import Number from sys import float_info +from tilequeue.process import _make_valid_if_necessary +from tilequeue.process import _visible_shape +from tilequeue.tile import calc_meters_per_pixel_area +from tilequeue.tile import normalize_geometry_type +from tilequeue.tile import tolerance_for_zoom +from tilequeue.transform import calculate_padded_bounds import hanzidentifier import kdtree @@ -28,12 +34,6 @@ from shapely.strtree import STRtree from sort import pois as sort_pois from StreetNames import short_street_name -from tilequeue.process import _make_valid_if_necessary -from tilequeue.process import _visible_shape -from tilequeue.tile import calc_meters_per_pixel_area -from tilequeue.tile import normalize_geometry_type -from tilequeue.tile import tolerance_for_zoom -from tilequeue.transform import calculate_padded_bounds from util import safe_int from util import to_float from zope.dottedname.resolve import resolve @@ -9295,7 +9295,7 @@ def _list_of_countries(value): # should have an ISO 3166-1 alpha-2 code, so should be 2 ASCII # latin characters. candidate = candidate.strip().lower() - if candidate == 'iso' or match('[a-z][a-z]', candidate): + if candidate == 'iso' or candidate == 'tlc' or match('[a-z][a-z]', candidate): countries.append(candidate) return countries diff --git a/yaml/boundaries.yaml b/yaml/boundaries.yaml index 6be094f84..e3c89c577 100644 --- a/yaml/boundaries.yaml +++ b/yaml/boundaries.yaml @@ -29,6 +29,7 @@ global: - &ne_localized_kind_properties 'kind:iso': {col: fclass_iso } + 'kind:tlc': {col: fclass_tlc } 'kind:ar': {col: fclass_ar } 'kind:bd': {col: fclass_bd } 'kind:br': {col: fclass_br } diff --git a/yaml/places.yaml b/yaml/places.yaml index 9ab087abd..72323ff3a 100644 --- a/yaml/places.yaml +++ b/yaml/places.yaml @@ -36,6 +36,7 @@ global: wikidata_id: {col: wikidata} disputed_by: {col: disputed_by } 'place:ISO': { col: 'place:ISO' } + 'place:TLC': { col: 'place:TLC' } 'place:AR': { col: 'place:AR' } 'place:BD': { col: 'place:BD' } 'place:BR': { col: 'place:BR' } @@ -83,6 +84,7 @@ global: - &alternate_fclass fclass_iso: { col: fclass_iso } + fclass_tlc: { col: fclass_tlc } fclass_ar: { col: fclass_ar } fclass_bd: { col: fclass_bd } fclass_br: { col: fclass_br }