From 2002c7f4fdb56300295c7cc0bf5a493248a978d6 Mon Sep 17 00:00:00 2001 From: tomasz t Date: Mon, 31 Jan 2022 00:26:23 +0100 Subject: [PATCH] changed how name is constructed for parcel lockers --- project.mml | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/project.mml b/project.mml index cafdf692bb..1e4813b870 100644 --- a/project.mml +++ b/project.mml @@ -1476,25 +1476,27 @@ Layer: FROM (SELECT -- This subselect allows filtering on the feature column way, - CONCAT( - name, - E'\n' || CONCAT( -- by doing this with a || if both the ele and height branches are null, this entire expression is null and only name is used - CASE - WHEN (tags ? 'ele') AND tags->'ele' ~ '^-?\d{1,4}(\.\d+)?$' - AND ("natural" IN ('peak', 'volcano', 'saddle') - OR tourism = 'alpine_hut' OR (tourism = 'information' AND tags->'information' = 'guidepost') - OR amenity = 'shelter') - THEN CONCAT(REPLACE(ROUND((tags->'ele')::NUMERIC)::TEXT, '-', U&'\2212'), U&'\00A0', 'm') END, - CASE - WHEN (tags ? 'height') AND tags->'height' ~ '^\d{1,3}(\.\d+)?$' - AND waterway = 'waterfall' - THEN CONCAT(ROUND((tags->'height')::NUMERIC)::TEXT, U&'\00A0', 'm') END, - CASE - WHEN (amenity = 'parcel_locker' AND ref IS NOT NULL) - THEN ref END + CASE + WHEN amenity = 'parcel_locker' + THEN CONCAT(COALESCE(tags->'brand', tags->'operator', name), E'\n' || ref) + ELSE + CONCAT( + name, + E'\n' || CONCAT( -- by doing this with a || if both the ele and height branches are null, this entire expression is null and only name is used + CASE + WHEN (tags ? 'ele') AND tags->'ele' ~ '^-?\d{1,4}(\.\d+)?$' + AND ("natural" IN ('peak', 'volcano', 'saddle') + OR tourism = 'alpine_hut' OR (tourism = 'information' AND tags->'information' = 'guidepost') + OR amenity = 'shelter') + THEN CONCAT(REPLACE(ROUND((tags->'ele')::NUMERIC)::TEXT, '-', U&'\2212'), U&'\00A0', 'm') END, + CASE + WHEN (tags ? 'height') AND tags->'height' ~ '^\d{1,3}(\.\d+)?$' + AND waterway = 'waterfall' + THEN CONCAT(ROUND((tags->'height')::NUMERIC)::TEXT, U&'\00A0', 'm') END + ) ) - ) AS name, - tags->'parking' as "parking", + END AS name, + tags->'parking' as "parking", COALESCE( 'aeroway_' || CASE WHEN aeroway IN ('gate', 'apron', 'helipad', 'aerodrome') THEN aeroway END, 'tourism_' || CASE WHEN tourism IN ('alpine_hut', 'apartment', 'artwork', 'camp_site', 'caravan_site', 'chalet', 'gallery', 'guest_house',