Skip to content

Commit

Permalink
More vertical objects rendering and tuning (#3158)
Browse files Browse the repository at this point in the history
  • Loading branch information
kocio-pl authored Jun 22, 2018
1 parent 5bf9221 commit 85918db
Show file tree
Hide file tree
Showing 7 changed files with 220 additions and 38 deletions.
92 changes: 64 additions & 28 deletions amenity-points.mss
Original file line number Diff line number Diff line change
Expand Up @@ -394,32 +394,30 @@
marker-clip: false;
}

[feature = 'man_made_mast'] {
[feature = 'man_made_mast']["tower:type" != 'lighting'],
[feature = 'man_made_mast']["tower:type" = 'lighting'][zoom >= 18] {
[zoom >= 15][height > 80],
[zoom >= 16][height > 40],
[zoom >= 17][height > 20],
[zoom >= 18] {
["tower:type" != 'lighting'] {
marker-file: url('symbols/towers/mast.svg');
marker-fill: @man-made-icon;
marker-placement: interior;
marker-clip: false;
}
["tower:type" = 'lighting'][zoom >= 18] {
marker-file: url('symbols/towers/mast.svg');
marker-fill: @man-made-icon;
marker-placement: interior;
marker-clip: false;
["tower:type" = 'lighting'] {
marker-file: url('symbols/towers/mast_lighting.svg');
marker-fill: @man-made-icon;
marker-placement: interior;
marker-clip: false;
}
}
["tower:type" = 'communication'] {
marker-file: url('symbols/towers/mast_communications.svg');
}
}
}

[feature = 'man_made_tower']["tower:type" = 'cooling'][zoom >= 15],
[feature = 'man_made_tower']["tower:type" = 'lighting'][zoom >= 18],
[feature = 'man_made_tower']["tower:type" = 'bell_tower'][zoom >= 18],
[feature = 'man_made_tower']["tower:type" != 'lighting']["tower:type" != 'bell_tower'] {
[feature = 'man_made_tower']["tower:type" = 'watchtower'][zoom >= 18],
[feature = 'man_made_tower']["tower:type" != 'cooling']["tower:type" != 'lighting']["tower:type" != 'bell_tower']["tower:type" != 'watchtower'] {
[zoom >= 13][height > 100],
[zoom >= 14][height > 50],
[zoom >= 15][height > 30],
Expand All @@ -431,27 +429,61 @@
["tower:type" = 'defensive'] {
marker-file: url('symbols/towers/tower_defensive.svg');
}
["tower:type" = 'observation'] {
marker-file: url('symbols/towers/tower_observation.svg');
["tower:type" = 'observation'],
["tower:type" = 'watchtower'] {
marker-file: url('symbols/towers/tower_observation.svg');
}
["tower:type" = 'bell_tower'] {
marker-file: url('symbols/towers/bell_tower.svg');
}
["tower:type" = 'lighting'] {
marker-file: url('symbols/towers/tower_lighting.svg');
["tower:construction" = 'lattice'] {
marker-file: url('symbols/towers/tower_lattice_lighting.svg');
}
["tower:type" = 'cooling'] {
marker-file: url('symbols/towers/tower_cooling.svg');
}
["tower:construction" = 'lattice'] {
marker-file: url('symbols/towers/tower_lattice.svg');
}
["tower:construction" = 'dish'] {
marker-file: url('symbols/towers/tower_dish.svg');
}
["tower:construction" = 'dome'] {
marker-file: url('symbols/towers/tower_dome.svg');
}
["tower:type" = 'communication'] {
marker-file: url('symbols/towers/tower_cantilever_communication.svg');
["tower:construction" = 'lattice'] {
marker-file: url('symbols/towers/tower_lattice_communication.svg');
}
["tower:construction" = 'dish'] {
marker-file: url('symbols/towers/tower_dish.svg');
}
["tower:construction" = 'dome'] {
marker-file: url('symbols/towers/tower_dome.svg');
}
}
["tower:type" = 'lighting'] {
marker-file: url('symbols/towers/tower_lighting.svg');
["tower:construction" = 'lattice'] {
marker-file: url('symbols/towers/tower_lattice_lighting.svg');
}
}
}
}

[feature = 'man_made_communications_tower'][zoom >= 13] {
marker-file: url('symbols/towers/communications_tower.svg');
marker-fill: @man-made-icon;
marker-placement: interior;
marker-clip: false;
}

[feature = 'man_made_chimney'] {
[zoom >= 16][height > 50],
[zoom >= 17][height > 30],
[zoom >= 18] {
marker-file: url('symbols/towers/chimney.svg');
marker-fill: @man-made-icon;
marker-placement: interior;
marker-clip: false;
}
}

Expand Down Expand Up @@ -1672,23 +1704,27 @@
[feature = 'natural_cave_entrance'][zoom >= 15],
[feature = 'man_made_mast'][zoom >= 18],
[feature = 'man_made_tower'][zoom >= 17],
[feature = 'man_made_water_tower'][zoom >= 17] {
[feature = 'man_made_communications_tower'][zoom >= 17],
[feature = 'man_made_water_tower'][zoom >= 17],
[feature = 'man_made_chimney'][zoom >= 17] {
text-name: "[name]";
text-size: @standard-font-size;
text-wrap-width: @standard-wrap-width;
text-line-spacing: @standard-line-spacing-size;
text-fill: black;
[feature = 'natural_cave_entrance'],
[feature = 'man_made_water_tower'] {
text-dy: 11;
}
[feature = 'natural_cave_entrance'] { text-dy: 11; }
[feature = 'man_made_cross'],
[feature = 'historic_wayside_cross'] {
text-dy: 6;
}
[feature = 'historic_city_gate'] { text-dy: 10; }
[feature = 'man_made_mast'] { text-dy: 10; }
[feature = 'man_made_tower'] { text-dy: 10; }
[feature = 'historic_city_gate'],
[feature = 'man_made_mast'],
[feature = 'man_made_tower'],
[feature = 'man_made_communications_tower'],
[feature = 'man_made_water_tower'],
[feature = 'man_made_chimney'] {
text-dy: 10;
}
text-face-name: @standard-font;
text-halo-radius: @standard-halo-radius;
text-halo-fill: @standard-halo-fill;
Expand Down
29 changes: 19 additions & 10 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -1607,7 +1607,8 @@ Layer:
'office' || CASE WHEN tags->'office' IN ('no', 'vacant', 'closed', 'disused', 'empty') OR (tags->'office') IS NULL THEN NULL ELSE '' END,
'leisure_' || CASE WHEN leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table',
'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,
'man_made_' || CASE WHEN (man_made IN ('mast', 'tower', 'water_tower', 'lighthouse', 'windmill', 'obelisk', 'communications_tower', 'chimney')
AND (tags->'location' NOT IN ('roof', 'rooftop') OR (tags->'location') IS NULL)) THEN man_made ELSE NULL END,
'natural_' || CASE WHEN "natural" IN ('spring') THEN "natural" ELSE NULL END,
'historic_' || CASE WHEN historic IN ('memorial', 'monument', 'archaeological_site', 'fort', 'castle', 'manor', 'city_gate')
THEN concat_ws('_', historic, CASE WHEN tags->'memorial' IN ('plaque') THEN tags->'memorial' ELSE NULL END)
Expand All @@ -1622,7 +1623,7 @@ Layer:
tags->'denomination' as denomination,
tags->'generator:source' as "generator:source",
CASE
WHEN man_made IN ('mast', 'tower') THEN
WHEN (man_made IN ('mast', 'tower', 'chimney') AND (tags->'location' NOT IN ('roof', 'rooftop') OR (tags->'location') IS NULL)) THEN
CASE
WHEN tags->'height' ~ '^-?\d{1,4}(\.\d+)?$' THEN (tags->'height')::NUMERIC
ELSE NULL
Expand Down Expand Up @@ -1660,7 +1661,8 @@ Layer:
OR (tags->'office') IS NOT NULL
OR leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'fitness_centre',
'fitness_station', 'firepit', 'sauna', 'beach_resort')
OR man_made IN ('mast', 'tower', 'water_tower', 'lighthouse', 'windmill', 'obelisk')
OR (man_made IN ('mast', 'tower', 'water_tower', 'lighthouse', 'windmill', 'obelisk', 'communications_tower', 'chimney')
AND (tags->'location' NOT IN ('roof', 'rooftop') OR (tags->'location') IS NULL))
OR "natural" IN ('spring')
OR historic IN ('memorial', 'monument', 'archaeological_site', 'fort', 'castle', 'manor', 'city_gate')
OR tags->'memorial' IN ('plaque')
Expand Down Expand Up @@ -1719,7 +1721,8 @@ Layer:
'office' || CASE WHEN tags->'office' IN ('no', 'vacant', 'closed', 'disused', 'empty') OR (tags->'office') IS NULL THEN NULL ELSE '' END,
'leisure_' || CASE WHEN leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'slipway',
'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,
'man_made_' || CASE WHEN (man_made IN ('mast', 'tower', 'water_tower', 'lighthouse', 'windmill', 'obelisk', 'communications_tower', 'chimney')
AND (tags->'location' NOT IN ('roof', 'rooftop') OR (tags->'location') IS NULL)) 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', 'city_gate')
Expand Down Expand Up @@ -1752,7 +1755,8 @@ Layer:
tags->'denomination' as denomination,
tags->'generator:source' as "generator:source",
CASE
WHEN man_made IN ('mast', 'tower') OR waterway IN ('waterfall') THEN
WHEN (man_made IN ('mast', 'tower', 'chimney') AND (tags->'location' NOT IN ('roof', 'rooftop') OR (tags->'location') IS NULL))
OR 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
Expand Down Expand Up @@ -1791,7 +1795,8 @@ Layer:
OR leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'slipway',
'dog_park', 'fitness_centre', 'fitness_station', 'firepit', 'sauna', 'beach_resort')
OR barrier IN ('toll_booth')
OR man_made IN ('mast', 'tower', 'water_tower', 'lighthouse', 'windmill', 'cross', 'obelisk')
OR (man_made IN ('mast', 'tower', 'water_tower', 'lighthouse', 'windmill', 'cross', 'obelisk', 'communications_tower', 'chimney')
AND (tags->'location' NOT IN ('roof', 'rooftop') OR (tags->'location') IS NULL))
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', 'city_gate')
Expand Down Expand Up @@ -2188,7 +2193,8 @@ Layer:
'residential', 'garages', 'meadow', 'grass', 'allotments', 'forest', 'farmyard', 'farmland',
'greenhouse_horticulture', 'retail', 'industrial', 'railway', 'commercial', 'brownfield', 'landfill',
'construction', 'military', 'plant_nursery', 'religious') THEN landuse ELSE NULL END,
'man_made_' || CASE WHEN man_made IN ('lighthouse', 'windmill', 'mast', 'tower', 'water_tower', 'pier', 'breakwater', 'groyne', 'obelisk', 'works') THEN man_made ELSE NULL END,
'man_made_' || CASE WHEN (man_made IN ('lighthouse', 'windmill', 'mast', 'tower', 'water_tower', 'pier', 'breakwater', 'groyne', 'obelisk', 'works', 'communications_tower', 'chimney')
AND (tags->'location' NOT IN ('roof', 'rooftop') OR (tags->'location') IS NULL)) THEN man_made ELSE NULL END,
'natural_' || CASE WHEN "natural" IN ('wood', 'water', 'mud', 'wetland', 'marsh', 'bay', 'spring', 'scree', 'shingle', 'bare_rock', 'sand', 'heath',
'grassland', 'scrub', 'beach', 'shoal', 'reef', 'glacier') THEN "natural" ELSE NULL END,
'place_' || CASE WHEN place IN ('island', 'islet') THEN place ELSE NULL END,
Expand Down Expand Up @@ -2240,7 +2246,8 @@ Layer:
OR (tags->'office') IS NOT NULL
OR leisure IS NOT NULL
OR landuse IS NOT NULL
OR man_made IN ('lighthouse', 'windmill', 'mast', 'tower', 'water_tower', 'pier', 'breakwater', 'groyne', 'obelisk', 'works')
OR (man_made IN ('lighthouse', 'windmill', 'mast', 'tower', 'water_tower', 'pier', 'breakwater', 'groyne', 'obelisk', 'works', 'communications_tower', 'chimney')
AND (tags->'location' NOT IN ('roof', 'rooftop') OR (tags->'location') IS NULL))
OR "natural" IS NOT NULL
OR place IN ('island', 'islet')
OR military IN ('danger_area', 'bunker')
Expand Down Expand Up @@ -2353,7 +2360,8 @@ Layer:
'residential', 'garages', 'meadow', 'grass', 'allotments', 'forest', 'farmyard', 'farmland',
'greenhouse_horticulture', 'retail', 'industrial', 'railway', 'commercial', 'brownfield', 'landfill',
'construction', 'military', 'plant_nursery') THEN landuse ELSE NULL END,
'man_made_' || CASE WHEN man_made IN ('lighthouse', 'windmill', 'mast', 'tower', 'water_tower', 'obelisk', 'works') THEN man_made ELSE NULL END,
'man_made_' || CASE WHEN (man_made IN ('lighthouse', 'windmill', 'mast', 'tower', 'water_tower', 'obelisk', 'works', 'communications_tower', 'chimney')
AND (tags->'location' NOT IN ('roof', 'rooftop') OR (tags->'location') IS NULL)) THEN man_made ELSE NULL END,
'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,
Expand Down Expand Up @@ -2416,7 +2424,8 @@ Layer:
OR landuse IN ('reservoir', 'basin', 'recreation_ground', 'village_green', 'quarry', 'vineyard', 'orchard', 'cemetery', 'residential',
'garages', 'meadow', 'grass', 'allotments', 'forest', 'farmyard', 'farmland', 'greenhouse_horticulture',
'retail', 'industrial', 'railway', 'commercial', 'brownfield', 'landfill', 'construction', 'military', 'plant_nursery')
OR man_made IN ('lighthouse', 'windmill', 'mast', 'tower', 'water_tower', 'cross', 'obelisk', 'works')
OR (man_made IN ('lighthouse', 'windmill', 'mast', 'tower', 'water_tower', 'cross', 'obelisk', 'works', 'communications_tower', 'chimney')
AND (tags->'location' NOT IN ('roof', 'rooftop') OR (tags->'location') IS NULL))
OR "natural" IS NOT NULL
OR waterway IN ('waterfall')
OR place IN ('island', 'islet')
Expand Down
16 changes: 16 additions & 0 deletions symbols/towers/chimney.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 56 additions & 0 deletions symbols/towers/communications_tower.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions symbols/towers/tower_cooling.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 85918db

Please sign in to comment.