Skip to content

Commit

Permalink
Merge pull request #4034 from imagico/way_pixels-limit-in-sql
Browse files Browse the repository at this point in the history
Adding upper way_pixels limit in SQL for amenity-points and text-poly-low-zoom layers
  • Loading branch information
pnorman authored Feb 23, 2020
2 parents 1b0dacb + 87ad68f commit 2b793ea
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 35 deletions.
66 changes: 31 additions & 35 deletions amenity-points.mss
Original file line number Diff line number Diff line change
Expand Up @@ -1577,10 +1577,10 @@
/* Note that these layers are also used in water.mss */
#text-poly-low-zoom[zoom < 10],
#text-point[zoom >= 10] {
[feature = 'place_island'][zoom >= 4][way_pixels > 3000][way_pixels <= 768000],
[feature = 'place_island'][zoom >= 16][way_pixels <= 768000],
[feature = 'place_islet'][zoom >= 11][way_pixels > 3000][way_pixels <= 768000],
[feature = 'place_islet'][zoom >= 17][way_pixels <= 768000] {
[feature = 'place_island'][zoom >= 4][way_pixels > 3000],
[feature = 'place_island'][zoom >= 16],
[feature = 'place_islet'][zoom >= 11][way_pixels > 3000],
[feature = 'place_islet'][zoom >= 17] {
text-name: "[name]";
text-fill: #000;
text-size: @landcover-font-size;
Expand Down Expand Up @@ -1968,9 +1968,7 @@
[feature = 'leisure_water_park'],
[feature = 'leisure_sports_centre'][sport = 'swimming'],
[feature = 'leisure_swimming_area'] {
[way_area >= 150000][zoom >= 14],
[way_area >= 80000][zoom >= 15],
[way_area >= 20000][zoom >= 16],
[zoom >= 14][way_pixels > 3000],
[zoom >= 17] {
text-name: "[name]";
text-size: @standard-font-size;
Expand All @@ -1985,8 +1983,8 @@
}

[feature = 'leisure_swimming_pool'][is_building = 'no'] {
[zoom >= 14][way_pixels > 3000][way_pixels <= 768000],
[zoom >= 17][way_pixels <= 768000] {
[zoom >= 14][way_pixels > 3000],
[zoom >= 17] {
text-name: "[name]";
text-size: @landcover-font-size;
text-wrap-width: @landcover-wrap-width-size;
Expand All @@ -2012,9 +2010,7 @@
[feature = 'leisure_dog_park'],
[feature = 'leisure_fitness_centre'],
[feature = 'leisure_fitness_station'] {
[way_area >= 150000][zoom >= 14],
[way_area >= 80000][zoom >= 15],
[way_area >= 20000][zoom >= 16],
[zoom >= 14][way_pixels > 3000],
[zoom >= 17] {
text-name: "[name]";
text-size: @standard-font-size;
Expand All @@ -2038,8 +2034,8 @@
[feature = 'leisure_nature_reserve'],
[feature = 'boundary_aboriginal_lands'],
[feature = 'boundary_protected_area'] {
[zoom >= 8][way_pixels > 3000][way_pixels <= 768000][is_building = 'no'],
[zoom >= 17][way_pixels <= 768000] {
[zoom >= 8][way_pixels > 3000][is_building = 'no'],
[zoom >= 17] {
text-name: "[name]";
text-size: @landcover-font-size;
text-wrap-width: @landcover-wrap-width-size;
Expand Down Expand Up @@ -2076,8 +2072,8 @@
}

[feature = 'military_danger_area'][is_building = 'no'] {
[zoom >= 9][way_pixels > 3000][way_pixels <= 768000],
[zoom >= 17][way_pixels <= 768000] {
[zoom >= 9][way_pixels > 3000],
[zoom >= 17] {
text-name: "[name]";
text-size: @landcover-font-size;
text-wrap-width: @landcover-wrap-width-size;
Expand All @@ -2100,8 +2096,8 @@
}

[feature = 'landuse_garages'][is_building = 'no'] {
[zoom >= 13][way_pixels > 3000][way_pixels <= 768000],
[zoom >= 17][way_pixels <= 768000] {
[zoom >= 13][way_pixels > 3000],
[zoom >= 17] {
text-name: "[name]";
text-size: @landcover-font-size;
text-wrap-width: @landcover-wrap-width-size;
Expand Down Expand Up @@ -2175,10 +2171,10 @@
[feature = 'leisure_dog_park'],
[feature = 'leisure_ice_rink'],
[feature = 'leisure_pitch'] {
[zoom >= 10][way_pixels > 3000][way_pixels <= 768000][is_building = 'no'],
[zoom >= 17][way_pixels <= 768000][is_building = 'no'],
[zoom >= 10][way_pixels > 3000][way_pixels <= 768000][shop = 'mall'],
[zoom >= 17][way_pixels <= 768000][shop = 'mall'] {
[zoom >= 10][way_pixels > 3000][is_building = 'no'],
[zoom >= 17][is_building = 'no'],
[zoom >= 10][way_pixels > 3000][shop = 'mall'],
[zoom >= 17][shop = 'mall'] {
text-name: "[name]";
text-size: @landcover-font-size;
text-wrap-width: @landcover-wrap-width-size;
Expand Down Expand Up @@ -2432,8 +2428,8 @@
}

[feature = 'leisure_marina'][zoom >= 15] {
[zoom >= 10][way_pixels > 3000][way_pixels <= 768000],
[zoom >= 17][way_pixels <= 768000] {
[zoom >= 10][way_pixels > 3000],
[zoom >= 17] {
text-name: "[name]";
text-size: @landcover-font-size;
text-wrap-width: @landcover-wrap-width-size;
Expand Down Expand Up @@ -2694,8 +2690,8 @@
[feature = 'power_generator'][is_building = 'no']["generator:source" != 'wind'][zoom >= 10],
[feature = 'power_sub_station'][is_building = 'no'][zoom >= 13],
[feature = 'power_substation'][is_building = 'no'][zoom >= 13]{
[way_pixels > 3000][way_pixels <= 768000],
[zoom >= 17][way_pixels <= 768000] {
[way_pixels > 3000],
[zoom >= 17] {
text-name: "[name]";
text-size: @landcover-font-size;
text-wrap-width: @landcover-wrap-width-size;
Expand All @@ -2721,8 +2717,8 @@
[feature = 'natural_shingle'][zoom >= 9],
[feature = 'natural_bare_rock'],
[feature = 'natural_sand'] {
[zoom >= 8][way_pixels > 3000][way_pixels <= 768000][is_building = 'no'],
[zoom >= 17][way_pixels <= 768000][is_building = 'no'] {
[zoom >= 8][way_pixels > 3000][is_building = 'no'],
[zoom >= 17][is_building = 'no'] {
text-name: "[name]";
text-size: @landcover-font-size;
text-wrap-width: @landcover-wrap-width-size;
Expand Down Expand Up @@ -2752,8 +2748,8 @@
}

[feature = 'aeroway_apron'][is_building = 'no'] {
[zoom >= 10][way_pixels > 3000][way_pixels <= 768000],
[zoom >= 17][way_pixels <= 768000] {
[zoom >= 10][way_pixels > 3000],
[zoom >= 17] {
text-name: "[name]";
text-size: @landcover-font-size;
text-wrap-width: @landcover-wrap-width-size;
Expand All @@ -2777,8 +2773,8 @@

[feature = 'highway_services'][is_building = 'no'],
[feature = 'highway_rest_area'][is_building = 'no'] {
[zoom >= 10][way_pixels > 3000][way_pixels <= 768000],
[zoom >= 17][way_pixels <= 768000] {
[zoom >= 10][way_pixels > 3000],
[zoom >= 17] {
text-name: "[name]";
text-size: @landcover-font-size;
text-wrap-width: @landcover-wrap-width-size;
Expand All @@ -2801,9 +2797,9 @@
}

[feature = 'natural_glacier'][is_building = 'no'] {
[zoom >= 8][way_pixels > 10000][way_pixels <= 768000],
[zoom >= 10][way_pixels > 750][way_pixels <= 768000],
[zoom >= 17][way_pixels <= 768000] {
[zoom >= 8][way_pixels > 10000],
[zoom >= 10][way_pixels > 750],
[zoom >= 17] {
text-name: "[name]";
text-size: @landcover-font-size;
text-wrap-width: @landcover-wrap-width-size;
Expand Down
2 changes: 2 additions & 0 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -1590,6 +1590,7 @@ Layer:
way_area
FROM planet_osm_polygon
WHERE way && !bbox!
AND way_area < 768000*POW(!scale_denominator!*0.001*0.28,2)
UNION ALL
SELECT
way,
Expand Down Expand Up @@ -1989,6 +1990,7 @@ Layer:
OR leisure IN ('nature_reserve'))
AND building IS NULL
AND name IS NOT NULL
AND way_area < 768000*POW(!scale_denominator!*0.001*0.28,2)
ORDER BY way_area DESC
) AS text_poly_low_zoom
properties:
Expand Down

0 comments on commit 2b793ea

Please sign in to comment.