From d2c261d9cab103b52fa52adf205bb5e47eeaf597 Mon Sep 17 00:00:00 2001 From: Paul Norman Date: Sun, 5 May 2019 22:01:30 -0700 Subject: [PATCH] Restore height and ele text This used to be done by processing in the subselects and the outer selects, now it's done in just the outer. --- project.mml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/project.mml b/project.mml index 6af7cb3a6d..bb6f64daad 100644 --- a/project.mml +++ b/project.mml @@ -1473,7 +1473,21 @@ Layer: FROM (SELECT -- This subselect allows filtering on the feature column way, - name, + 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') ELSE NULL 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') ELSE NULL END + ) + ) AS name, COALESCE( 'aeroway_' || CASE WHEN aeroway IN ('gate', 'apron', 'helipad', 'aerodrome') THEN aeroway ELSE NULL END, 'tourism_' || CASE WHEN tourism IN ('alpine_hut', 'apartment', 'artwork', 'camp_site', 'caravan_site', 'chalet', 'gallery', 'guest_house',