Skip to content

Commit

Permalink
Buildings code rewrite (#3426)
Browse files Browse the repository at this point in the history
  • Loading branch information
meased authored and kocio-pl committed Oct 19, 2018
1 parent 9f578c4 commit 6ac2d9c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 43 deletions.
19 changes: 5 additions & 14 deletions buildings.mss
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,20 @@
[zoom >= 13] {
polygon-fill: @building-low-zoom;
polygon-clip: false;
line-width: 0;
[zoom >= 15] {
line-color: @building-line;
polygon-fill: @building-fill;
line-color: @building-line;
line-width: .75;
line-clip: false;
}
}
}

#buildings-major {
[zoom >= 13] {
[aeroway = 'terminal'],
[amenity = 'place_of_worship'],
[building = 'train_station'],
[aeroway = 'terminal'],
[aerialway = 'station'],
[building = 'train_station'],
[public_transport = 'station'] {
polygon-fill: @building-major-fill;
polygon-clip: false;
[zoom >= 15] {
line-width: .75;
line-clip: false;
line-color: @building-major-line;
}
line-color: @building-major-line;
}
}
}
Expand Down
31 changes: 2 additions & 29 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -418,28 +418,6 @@ Layer:
properties:
minzoom: 12
- id: buildings
geometry: polygon
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way,
building
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 (aerialway IS NULL OR aerialway != 'station')
AND ((tags->'public_transport') IS NULL OR tags->'public_transport' != 'station')
AND way_area > 1*!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:
Expand All @@ -455,14 +433,9 @@ Layer:
FROM planet_osm_polygon
WHERE building IS NOT NULL
AND building != 'no'
AND (aeroway = 'terminal'
OR amenity = 'place_of_worship'
OR building = 'train_station'
OR aerialway = 'station'
OR tags->'public_transport' = 'station')
AND way_area > 1*!pixel_width!::real*!pixel_height!::real
ORDER BY COALESCE(layer,0), way_area DESC)
AS buildings_major
ORDER BY COALESCE(layer,0), way_area DESC
) AS buildings
properties:
minzoom: 13
- id: tunnels
Expand Down

0 comments on commit 6ac2d9c

Please sign in to comment.