Skip to content

Commit

Permalink
Merge pull request #3774 from pnorman/ele_height_fix
Browse files Browse the repository at this point in the history
Restore height and ele text
  • Loading branch information
pnorman authored May 10, 2019
2 parents c6f2cd4 + d2c261d commit d4f1514
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit d4f1514

Please sign in to comment.