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 Shading for places defined as areas #2806

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions landcover.mss
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,22 @@
[way_pixels >= 64] { polygon-gamma: 0.3; }
}

[feature = 'place_village'],
[feature = 'place_hamlet'][zoom >= 10] {
polygon-fill: @built-up-lower-lowzoom;
[zoom >= 11] { polygon-fill: @built-up-upper-lowzoom; }
[zoom >= 13] { polygon-fill: lighten(@residential, 30%); }
[zoom >= 16] {
line-width: .5;
line-color: lighten(@residential-line, 30%);
[name != ''] {
line-width: 0.7;
}
}
[way_pixels >= 4] { polygon-gamma: 0.75; }
[way_pixels >= 64] { polygon-gamma: 0.3; }
}

[feature = 'landuse_garages'][zoom >= 13] {
polygon-fill: @garages;
[way_pixels >= 4] { polygon-gamma: 0.75; }
Expand Down
6 changes: 4 additions & 2 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ Layer:
'allotments', 'forest', 'farmyard', 'farmland', 'greenhouse_horticulture',
'recreation_ground', 'village_green', 'retail', 'industrial', 'railway', 'commercial',
'brownfield', 'landfill', 'construction', 'plant_nursery') THEN landuse ELSE NULL END)) AS landuse,
('place_' || (CASE WHEN place IN ('village', 'hamlet') THEN place ELSE NULL END)) AS place,
('leisure_' || (CASE WHEN leisure IN ('swimming_pool', 'playground', 'park', 'recreation_ground', 'common', 'garden',
'golf_course', 'miniature_golf', 'picnic_table', 'fitness_centre', 'sports_centre', 'stadium', 'pitch',
'track', 'dog_park') THEN leisure ELSE NULL END)) AS leisure,
Expand All @@ -149,6 +150,7 @@ Layer:
way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels
FROM planet_osm_polygon
WHERE (landuse IS NOT NULL
OR place IN ('village','hamlet')
OR leisure IS NOT NULL
OR aeroway IN ('apron', 'aerodrome')
OR amenity IN ('parking', 'bicycle_parking', 'motorcycle_parking', 'university', 'college', 'school', 'hospital', 'kindergarten',
Expand Down Expand Up @@ -1905,7 +1907,7 @@ Layer:
'man_made_' || CASE WHEN man_made IN ('lighthouse', 'windmill', 'mast', 'water_tower', 'pier', 'breakwater', 'groyne', 'obelisk') 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,
'place_' || CASE WHEN place IN ('island', 'islet', 'village', 'hamlet') THEN place ELSE NULL END,
'military_' || CASE WHEN military IN ('danger_area') THEN military ELSE NULL END,
'historic_' || CASE WHEN historic IN ('memorial', 'monument', 'archaeological_site')
THEN concat_ws('_', historic, CASE WHEN tags->'memorial' IN ('plaque') THEN tags->'memorial' ELSE NULL END)
Expand Down Expand Up @@ -1934,7 +1936,7 @@ Layer:
OR landuse IS NOT NULL
OR man_made IN ('lighthouse', 'windmill', 'mast', 'water_tower', 'pier', 'breakwater', 'groyne', 'obelisk')
OR "natural" IS NOT NULL
OR place IN ('island', 'islet')
OR place IN ('island', 'islet', 'village', 'hamlet')
OR military IN ('danger_area')
OR historic IN ('memorial', 'monument', 'archaeological_site')
OR tags->'memorial' IN ('plaque')
Expand Down