Skip to content

Commit

Permalink
simplifying building rendering and adding distinct rendering of
Browse files Browse the repository at this point in the history
building=roof and building=greenhouse at z18+
  • Loading branch information
imagico committed Jan 29, 2019
1 parent 99e5738 commit 7e99531
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 28 deletions.
19 changes: 14 additions & 5 deletions buildings.mss
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,25 @@
@building-line: darken(@building-fill, 15%);
@building-low-zoom: darken(@building-fill, 4%);

#buildings,
#buildings-major {
#buildings {
[zoom >= 13] {
polygon-fill: @building-low-zoom;
polygon-clip: false;
[zoom >= 15] {
line-color: @building-line;
[zoom >= 18] {
[building = 'greenhouse'] {
a/line-width: 2.5;
a/line-offset: -1.25;
a/line-color: @land-color;
}
[building = 'roof'] {
b/line-dasharray: 4,1.5;
}
}
polygon-fill: @building-fill;
line-width: .75;
line-clip: false;
b/line-color: @building-line;
b/line-width: .75;
b/line-clip: false;
}
}
}
Expand Down
23 changes: 0 additions & 23 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -949,34 +949,11 @@ Layer:
FROM planet_osm_polygon
WHERE building IS NOT NULL
AND building != 'no'
AND (aeroway IS NULL OR aeroway != 'terminal')
AND (amenity IS NULL OR amenity != 'place_of_worship')
AND building != 'train_station'
AND way_area > 0.01*!pixel_width!::real*!pixel_height!::real
ORDER BY COALESCE(layer,0), way_area DESC
) AS buildings
properties:
minzoom: 13
- id: buildings-major
geometry: polygon
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way,
building,
amenity,
aeroway
FROM planet_osm_polygon
WHERE building IS NOT NULL
AND building != 'no'
AND (aeroway = 'terminal' OR amenity = 'place_of_worship' OR building = 'train_station')
AND way_area > 0.01*!pixel_width!::real*!pixel_height!::real
ORDER BY COALESCE(layer,0), way_area DESC)
AS buildings_major
properties:
minzoom: 13
- id: tunnels
class: tunnels-fill tunnels-casing access
geometry: linestring
Expand Down

0 comments on commit 7e99531

Please sign in to comment.