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

Buildings code rewrite #3426

Merged
merged 13 commits into from
Oct 19, 2018
47 changes: 31 additions & 16 deletions buildings.mss
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
@building-line: darken(@building-fill, 15%);
@building-low-zoom: darken(@building-fill, 4%);

@building-major-fill: darken(@building-fill, 20%);
@building-major-line: darken(@building-major-fill, 25%);
@building-major-fill: darken(@building-fill, 10%);
@building-major-line: darken(@building-major-fill, 12%);

@building-minor-fill: lighten(@building-fill, 7%);
@building-minor-line: darken(@building-minor-fill, 12%);

@entrance-permissive: darken(@building-line, 15%);
@entrance-normal: @building-line;
Expand All @@ -12,29 +15,41 @@
[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;
}
[building = 'roof'],
[building = 'construction'],
[building = 'damaged'],
[building = 'collapsed'],
[building = 'underground'],
[building = 'service'],
[building = 'slurry_tank'],
[building = 'shed'],
[building = 'garage'],
[building = 'garages'],
[building = 'farm_auxiliary'],
[building = 'carport'],
[building = 'barn'],
[building = 'stable'],
[building = 'cowshed'],
[building = 'greenhouse'],
[building = 'ger'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is that?

I miss =hut and perhaps =cabin in the list.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[building = 'ruins'] {
polygon-fill: @building-minor-fill;
line-color: @building-minor-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