Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rendering for waterway=waterfall #3164

Merged
merged 12 commits into from
Apr 17, 2018
32 changes: 31 additions & 1 deletion amenity-points.mss
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,19 @@
marker-placement: interior;
marker-clip: false;
}


[feature = 'waterway_waterfall'] {
[zoom >= 13][height > 20],
[zoom >= 14][height > 10],
[zoom >= 15][name != null],
[zoom >= 16] {
marker-file: url('symbols/waterfall.svg');
marker-placement: interior;
marker-clip: false;
marker-fill: @water-text;
}
}

[feature = 'military_bunker'][zoom >= 17] {
marker-file: url('symbols/bunker.svg');
marker-fill: @man-made-icon;
Expand Down Expand Up @@ -1552,6 +1564,24 @@
text-placement: interior;
}

[feature = 'waterway_waterfall'] {
[zoom >= 13][height > 20],
[zoom >= 14][height > 10],
[zoom >= 15][name != null],
[zoom >= 16] {
text-name: "[name]";
text-size: @standard-font-size;
text-wrap-width: @standard-wrap-width;
text-line-spacing: @standard-line-spacing-size;
text-fill: @water-text;
text-dy: 10;
text-face-name: @standard-font;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
text-placement: interior;
}
}

[feature = 'man_made_cross'][zoom >= 17],
[feature = 'historic_wayside_cross'][zoom >= 17],
[feature = 'historic_wayside_shrine'][zoom >= 17],
Expand Down
39 changes: 35 additions & 4 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -1430,6 +1430,7 @@ Layer:
table: |-
(SELECT
way,
name,
COALESCE(
'aeroway_' || CASE WHEN aeroway IN ('helipad', 'aerodrome') THEN aeroway ELSE NULL END,
'tourism_' || CASE WHEN tourism IN ('artwork', 'alpine_hut', 'camp_site', 'caravan_site', 'chalet', 'wilderness_hut', 'guest_house', 'apartment',
Expand Down Expand Up @@ -1534,6 +1535,7 @@ Layer:
table: |-
(SELECT
way,
name,
COALESCE(
'aeroway_' || CASE WHEN aeroway IN ('helipad', 'aerodrome') THEN aeroway ELSE NULL END,
'tourism_' || CASE WHEN tourism IN ('artwork', 'alpine_hut', 'camp_site', 'caravan_site', 'chalet', 'wilderness_hut', 'guest_house', 'apartment', 'hostel',
Expand All @@ -1553,6 +1555,7 @@ Layer:
'dog_park', 'fitness_centre', 'fitness_station', 'firepit', 'sauna', 'beach_resort') THEN leisure ELSE NULL END,
'man_made_' || CASE WHEN man_made IN ('mast', 'tower', 'water_tower', 'lighthouse', 'windmill', 'obelisk') THEN man_made ELSE NULL END,
'natural_' || CASE WHEN "natural" IN ('peak', 'volcano', 'saddle', 'spring', 'cave_entrance') THEN "natural" ELSE NULL END,
'waterway_' || CASE WHEN "waterway" IN ('waterfall') THEN waterway ELSE NULL END,
'historic_' || CASE WHEN historic IN ('memorial', 'monument', 'archaeological_site', 'fort', 'castle', 'manor')
THEN concat_ws('_', historic, CASE WHEN tags->'memorial' IN ('plaque') THEN tags->'memorial' ELSE NULL END)
ELSE NULL END,
Expand All @@ -1572,15 +1575,20 @@ Layer:
WHEN tags->'ele' ~ '^-?\d{1,4}(\.\d+)?$' THEN (tags->'ele')::NUMERIC
ELSE NULL
END
WHEN "waterway" IN ('waterfall') THEN
CASE
WHEN tags->'height' ~ '^\d{1,3}(\.\d+)?( m)?$' THEN (SUBSTRING(tags->'height', '^(\d{1,3}(\.\d+)?)( m)?$'))::NUMERIC
ELSE NULL
END
ELSE NULL
END AS score,
religion,
tags->'denomination' as denomination,
tags->'generator:source' as "generator:source",
CASE
WHEN man_made IN ('mast', 'tower') THEN
WHEN man_made IN ('mast', 'tower') OR waterway IN ('waterfall') THEN
CASE
WHEN tags->'height' ~ '^-?\d{1,4}(\.\d+)?$' THEN (tags->'height')::NUMERIC
WHEN tags->'height' ~ '^\d{1,3}(\.\d+)?( m)?$' THEN (SUBSTRING(tags->'height', '^(\d{1,3}(\.\d+)?)( m)?$'))::NUMERIC
ELSE NULL
END
ELSE NULL
Expand Down Expand Up @@ -1615,6 +1623,7 @@ Layer:
OR barrier IN ('toll_booth')
OR man_made IN ('mast', 'tower', 'water_tower', 'lighthouse', 'windmill', 'cross', 'obelisk')
OR "natural" IN ('peak', 'volcano', 'saddle', 'spring', 'cave_entrance')
OR waterway IN ('waterfall')
OR historic IN ('memorial', 'monument', 'archaeological_site', 'wayside_cross', 'fort', 'wayside_shrine', 'castle', 'manor')
OR tags->'memorial' IN ('plaque')
OR military IN ('bunker')
Expand Down Expand Up @@ -2027,6 +2036,14 @@ Layer:
NULL
END
) AS name,
CASE
WHEN "waterway" IN ('waterfall') THEN
CASE
WHEN tags->'height' ~ '^\d{1,3}(\.\d+)?( m)?$' THEN (SUBSTRING(tags->'height', '^(\d{1,3}(\.\d+)?)( m)?$'))::NUMERIC
ELSE NULL
END
ELSE NULL
END AS height,
tags->'operator' as operator,
tags->'icao' as icao,
tags->'iata' as iata,
Expand Down Expand Up @@ -2102,13 +2119,16 @@ Layer:
access,
CONCAT(
name,
CASE WHEN name IS NOT NULL AND elevation IS NOT NULL THEN E'\n' ELSE NULL END,
CASE WHEN elevation IS NOT NULL THEN CONCAT(REPLACE(ROUND(elevation)::TEXT, '-', U&'\2212'), U&'\00A0', 'm') ELSE NULL END
CASE WHEN name IS NOT NULL AND (elevation IS NOT NULL OR height IS NOT NULL) THEN E'\n' ELSE NULL END,
CASE WHEN elevation IS NOT NULL THEN CONCAT(REPLACE(ROUND(elevation)::TEXT, '-', U&'\2212'), U&'\00A0', 'm') ELSE NULL END,
CASE WHEN height IS NOT NULL THEN CONCAT(ROUND(height)::TEXT, U&'\00A0', 'm') ELSE NULL END
) AS name,
CASE
WHEN "natural" IN ('peak', 'volcano', 'saddle') THEN elevation
WHEN "waterway" IN ('waterfall') THEN height
ELSE NULL
END AS score,
height,
operator,
icao,
iata,
Expand Down Expand Up @@ -2157,6 +2177,7 @@ Layer:
'natural_' || CASE WHEN "natural" IN ('wood', 'peak', 'volcano', 'saddle', 'cave_entrance', 'water', 'mud', 'wetland', 'marsh', 'bay', 'spring',
'scree', 'shingle', 'bare_rock', 'sand', 'heath', 'grassland', 'scrub', 'beach', 'glacier', 'tree')
THEN "natural" ELSE NULL END,
'waterway_' || CASE WHEN waterway IN ('waterfall') THEN waterway ELSE NULL END,
'place_' || CASE WHEN place IN ('island', 'islet') THEN place ELSE NULL END,
'barrier_' || CASE WHEN barrier IN ('toll_booth') THEN barrier ELSE NULL END,
'military_' || CASE WHEN military IN ('danger_area', 'bunker') THEN military ELSE NULL END,
Expand All @@ -2180,7 +2201,16 @@ Layer:
END
ELSE NULL
END AS elevation,
CASE
WHEN "waterway" IN ('waterfall') THEN
CASE
WHEN tags->'height' ~ '^\d{1,3}(\.\d+)?( m)?$' THEN (SUBSTRING(tags->'height', '^(\d{1,3}(\.\d+)?)( m)?$'))::NUMERIC
ELSE NULL
END
ELSE NULL
END AS height,
"natural",
waterway,
tags->'operator' as operator,
tags->'icao' as icao,
tags->'iata' as iata,
Expand All @@ -2203,6 +2233,7 @@ Layer:
'retail', 'industrial', 'railway', 'commercial', 'brownfield', 'landfill', 'construction', 'military', 'plant_nursery')
OR man_made IN ('lighthouse', 'windmill', 'mast', 'tower', 'water_tower', 'cross', 'obelisk', 'works')
OR "natural" IS NOT NULL
OR waterway IN ('waterfall')
OR place IN ('island', 'islet')
OR barrier IN ('toll_booth')
OR military IN ('danger_area', 'bunker')
Expand Down
4 changes: 4 additions & 0 deletions symbols/waterfall.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.