From 110ed8cd7d7bb5e4f4300b751ba1b5a90cab5c2a Mon Sep 17 00:00:00 2001 From: Alan McConchie Date: Thu, 22 Nov 2018 12:55:01 -0800 Subject: [PATCH 1/5] add aboriginal areas --- admin.mss | 45 ++++++++++++++++++++++++++++++++++++ amenity-points.mss | 9 +++++++- project.mml | 57 +++++++++++++++++++++++++++++++++++++++++----- 3 files changed, 104 insertions(+), 7 deletions(-) diff --git a/admin.mss b/admin.mss index 750c33df14..9ac7d93f64 100644 --- a/admin.mss +++ b/admin.mss @@ -252,3 +252,48 @@ overlapping borders correctly. } } } + +#aboriginal-lands-text[zoom >= 13][way_pixels > 192000] { + text-name: "[name]"; + text-face-name: @book-fonts; + text-fill: @aboriginal; + text-halo-radius: @standard-halo-radius; + text-halo-fill: @standard-halo-fill; + text-placement: line; + text-clip: true; + text-vertical-alignment: middle; + text-dy: -10; +} + +#aboriginal-lands-boundaries { + [way_pixels > 3000][zoom >= 8] { + [zoom < 10] { + ::fill { + opacity: 0.05; + polygon-fill: @aboriginal; + } + } + a/line-width: 1; + a/line-offset: -0.5; + a/line-color: @aboriginal; + a/line-opacity: 0.15; + a/line-join: round; + a/line-cap: round; + b/line-width: 2; + b/line-offset: -1; + b/line-color: @aboriginal; + b/line-opacity: 0.15; + b/line-join: round; + b/line-cap: round; + [zoom >= 10] { + a/line-width: 2; + a/line-offset: -1; + b/line-width: 4; + b/line-offset: -2; + } + [zoom >= 14] { + b/line-width: 6; + b/line-offset: -3; + } + } +} diff --git a/amenity-points.mss b/amenity-points.mss index 2a67263a86..23c7af8177 100644 --- a/amenity-points.mss +++ b/amenity-points.mss @@ -19,6 +19,7 @@ @advertising-grey: @man-made-icon; @landform-color: #d08f55; @leisure-green: darken(@park, 60%); +@aboriginal: #82643a; @landcover-font-size: 10; @landcover-wrap-width-size: 30; // 3 em @@ -2085,7 +2086,9 @@ [feature = 'natural_wood'], [feature = 'landuse_forest'], [feature = 'boundary_national_park'], - [feature = 'leisure_nature_reserve'] { + [feature = 'leisure_nature_reserve'], + [feature = 'boundary_aboriginal_lands'], + [feature = 'boundary_protected_area'] { [zoom >= 8][way_pixels > 3000][is_building = 'no'], [zoom >= 17] { text-name: "[name]"; @@ -2109,6 +2112,10 @@ [feature = 'landuse_military'] { text-fill: darken(@military, 40%); } + [feature = 'boundary_aboriginal_lands'], + [feature = 'boundary_protected_area'] { + text-fill: @aboriginal; + } [feature = 'natural_wood'], [feature = 'landuse_forest'] { text-fill: @forest-text; diff --git a/project.mml b/project.mml index 9d0e354706..62469366cd 100644 --- a/project.mml +++ b/project.mml @@ -1233,6 +1233,25 @@ Layer: ) AS national_park_boundaries properties: minzoom: 8 + - id: aboriginal-lands-boundaries + geometry: polygon + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, + name, + boundary, + way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels + FROM planet_osm_polygon + WHERE (boundary = 'aboriginal_lands' + OR (boundary = 'protected_area' AND tags->'protect_class' = '24')) + AND building IS NULL + AND way_area > 1*!pixel_width!::real*!pixel_height!::real + ) AS aboriginal_lands_boundaries + properties: + minzoom: 8 - id: trees geometry: polygon <<: *extents @@ -2024,7 +2043,9 @@ Layer: 'natural_' || CASE WHEN "natural" IN ('wood', 'glacier', 'sand', 'scree', 'shingle', 'bare_rock', 'water', 'bay', 'strait') THEN "natural" ELSE NULL END, 'place_' || CASE WHEN place IN ('island') THEN place ELSE NULL END, - 'boundary_' || CASE WHEN boundary IN ('national_park') THEN boundary ELSE NULL END, + 'boundary_' || CASE WHEN boundary IN ('aboriginal_lands', 'national_park') + OR (boundary = 'protected_area' AND tags->'protect_class' = '24') + THEN boundary ELSE NULL END, 'leisure_' || CASE WHEN leisure IN ('nature_reserve') THEN leisure ELSE NULL END ) AS feature, name, @@ -2034,7 +2055,8 @@ Layer: OR military IN ('danger_area') OR "natural" IN ('wood', 'glacier', 'sand', 'scree', 'shingle', 'bare_rock', 'water', 'bay', 'strait') OR "place" IN ('island') - OR boundary IN ('national_park') + OR boundary IN ('aboriginal_lands', 'national_park') + OR (boundary = 'protected_area' AND tags->'protect_class' = '24') OR leisure IN ('nature_reserve')) AND building IS NULL AND name IS NOT NULL @@ -2100,7 +2122,9 @@ Layer: 'historic_' || CASE WHEN historic IN ('memorial', 'monument', 'archaeological_site', 'fort', 'castle', 'manor', 'city_gate') THEN historic ELSE NULL END, 'highway_' || CASE WHEN highway IN ('services', 'rest_area', 'bus_stop', 'elevator') THEN highway ELSE NULL END, - 'boundary_' || CASE WHEN boundary IN ('national_park') THEN boundary ELSE NULL END, + 'boundary_' || CASE WHEN boundary IN ('aboriginal_lands', 'national_park') + OR (boundary = 'protected_area' AND tags->'protect_class' = '24') + THEN boundary ELSE NULL END, 'waterway_' || CASE WHEN waterway IN ('dam', 'dock') THEN waterway ELSE NULL END, 'tourism_' || CASE WHEN tourism IN ('viewpoint', 'attraction') THEN tourism ELSE NULL END ) AS feature, @@ -2164,7 +2188,8 @@ Layer: OR historic IN ('memorial', 'monument', 'archaeological_site', 'fort', 'castle', 'manor', 'city_gate') OR highway IN ('services', 'rest_area', 'bus_stop', 'elevator') OR power IN ('plant', 'station', 'generator', 'sub_station', 'substation') - OR boundary IN ('national_park') + OR boundary IN ('aboriginal_lands', 'national_park') + OR (boundary = 'protected_area' AND tags->'protect_class' = '24') OR waterway IN ('dam', 'dock')) AND (name IS NOT NULL OR (ref IS NOT NULL AND aeroway IN ('gate')) @@ -2288,7 +2313,9 @@ Layer: 'historic_' || CASE WHEN historic IN ('memorial', 'monument', 'archaeological_site', 'fort', 'castle', 'manor', 'city_gate') THEN historic ELSE NULL END, 'highway_' || CASE WHEN highway IN ('services', 'rest_area', 'bus_stop', 'elevator') THEN highway ELSE NULL END, - 'boundary_' || CASE WHEN boundary IN ('national_park') THEN boundary ELSE NULL END, + 'boundary_' || CASE WHEN boundary IN ('aboriginal_lands', 'national_park') + OR (boundary = 'protected_area' AND tags->'protect_class' = '24') + THEN boundary ELSE NULL END, 'waterway_' || CASE WHEN waterway IN ('dam', 'weir', 'dock') THEN waterway ELSE NULL END, 'tourism_' || CASE WHEN tourism IN ('viewpoint', 'attraction') THEN tourism ELSE NULL END, 'man_made_' || CASE WHEN man_made IN ('cross') THEN man_made ELSE NULL END, @@ -2354,7 +2381,8 @@ Layer: OR historic IN ('memorial', 'monument', 'archaeological_site', 'wayside_cross', 'fort', 'wayside_shrine', 'castle', 'manor', 'city_gate') OR highway IN ('bus_stop', 'services', 'rest_area', 'elevator') OR power IN ('plant', 'station', 'generator', 'sub_station', 'substation') - OR boundary IN ('national_park') + OR boundary IN ('aboriginal_lands', 'national_park') + OR (boundary = 'protected_area' AND tags->'protect_class' = '24') OR waterway IN ('dam', 'weir', 'dock')) AND (name IS NOT NULL OR (tags?'ele' AND ("natural" IN ('peak', 'volcano', 'saddle') @@ -2500,6 +2528,23 @@ Layer: ) AS nature_reserve_text properties: minzoom: 13 + - id: aboriginal-lands-text + geometry: linestring + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, + name, + way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels + FROM planet_osm_polygon + WHERE (boundary = 'aboriginal_lands' + OR (boundary = 'protected_area' AND tags->'protect_class' = '24')) + AND name IS NOT NULL + ) AS aboriginal_lands_text + properties: + minzoom: 13 - id: amenity-low-priority class: amenity-low-priority geometry: point From 525ee1e45c1d3867c396deee7f2f7b686ad7b6cf Mon Sep 17 00:00:00 2001 From: Alan McConchie Date: Sun, 27 Jan 2019 16:28:39 -0800 Subject: [PATCH 2/5] combine nature-reserve and aboriginal-lands layers into single protected-areas layer --- admin.mss | 69 +++++++++++++++++------------------------------------ project.mml | 55 +++++++++--------------------------------- 2 files changed, 33 insertions(+), 91 deletions(-) diff --git a/admin.mss b/admin.mss index 203fa3b6c4..8dda2a1e65 100644 --- a/admin.mss +++ b/admin.mss @@ -220,10 +220,14 @@ overlapping borders correctly. text-dy: -10; } -#nature-reserve-text[zoom >= 13][way_pixels > 192000] { +#protected-areas-text[zoom >= 13][way_pixels > 192000] { text-name: "[name]"; text-face-name: @book-fonts; text-fill: green; + [boundary='aboriginal_lands'], + [class='24'] { + text-fill: @aboriginal; + } text-halo-radius: @standard-halo-radius; text-halo-fill: @standard-halo-fill; text-largest-bbox-only: false; @@ -236,17 +240,25 @@ overlapping borders correctly. text-dy: -10; } -#nature-reserve-boundaries { +#protected-areas { [way_pixels > 3000] { [zoom >= 8][zoom < 10] { ::fill { opacity: 0.05; polygon-fill: green; + [boundary='aboriginal_lands'], + [class='24'] { + polygon-fill: @aboriginal; + } } ::outline { opacity: 0.25; line-width: 1.2; line-color: green; + [boundary='aboriginal_lands'], + [class='24'] { + line-color: @aboriginal; + } [zoom >= 9] { line-width: 1.5; } @@ -258,6 +270,10 @@ overlapping borders correctly. line-width: 3.6; line-offset: -0.9; line-color: green; + [boundary='aboriginal_lands'], + [class='24'] { + line-color: @aboriginal; + } line-join: round; line-cap: round; [zoom >= 12] { @@ -273,6 +289,10 @@ overlapping borders correctly. opacity: 0.15; line-width: 1.8; line-color: green; + [boundary='aboriginal_lands'], + [class='24'] { + line-color: @aboriginal; + } line-join: round; line-cap: round; [zoom >= 12] { @@ -282,48 +302,3 @@ overlapping borders correctly. } } } - -#aboriginal-lands-text[zoom >= 13][way_pixels > 192000] { - text-name: "[name]"; - text-face-name: @book-fonts; - text-fill: @aboriginal; - text-halo-radius: @standard-halo-radius; - text-halo-fill: @standard-halo-fill; - text-placement: line; - text-clip: true; - text-vertical-alignment: middle; - text-dy: -10; -} - -#aboriginal-lands-boundaries { - [way_pixels > 3000][zoom >= 8] { - [zoom < 10] { - ::fill { - opacity: 0.05; - polygon-fill: @aboriginal; - } - } - a/line-width: 1; - a/line-offset: -0.5; - a/line-color: @aboriginal; - a/line-opacity: 0.15; - a/line-join: round; - a/line-cap: round; - b/line-width: 2; - b/line-offset: -1; - b/line-color: @aboriginal; - b/line-opacity: 0.15; - b/line-join: round; - b/line-cap: round; - [zoom >= 10] { - a/line-width: 2; - a/line-offset: -1; - b/line-width: 4; - b/line-offset: -2; - } - [zoom >= 14] { - b/line-width: 6; - b/line-offset: -3; - } - } -} diff --git a/project.mml b/project.mml index ed1a402990..19aa5f9622 100644 --- a/project.mml +++ b/project.mml @@ -1231,27 +1231,7 @@ Layer: ) AS power_line properties: minzoom: 14 - - id: nature-reserve-boundaries - geometry: polygon - <<: *extents - Datasource: - <<: *osm2pgsql - table: |- - (SELECT - way, - name, - boundary, - way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels - FROM planet_osm_polygon - WHERE (boundary = 'national_park' - OR leisure = 'nature_reserve' - OR (boundary = 'protected_area' AND tags->'protect_class' IN ('1','1a','1b','2','3','4','5','6','7','97','98','99'))) - AND building IS NULL - AND way_area > 1*!pixel_width!::real*!pixel_height!::real - ) AS national_park_boundaries - properties: - minzoom: 8 - - id: aboriginal-lands-boundaries + - id: protected-areas geometry: polygon <<: *extents Datasource: @@ -1261,13 +1241,16 @@ Layer: way, name, boundary, + tags->'protect_class' AS class, way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels FROM planet_osm_polygon WHERE (boundary = 'aboriginal_lands' - OR (boundary = 'protected_area' AND tags->'protect_class' = '24')) + OR boundary = 'national_park' + OR leisure = 'nature_reserve' + OR (boundary = 'protected_area' AND tags->'protect_class' IN ('1','1a','1b','2','3','4','5','6','7','24','97','98','99'))) AND building IS NULL AND way_area > 1*!pixel_width!::real*!pixel_height!::real - ) AS aboriginal_lands_boundaries + ) AS protected_areas properties: minzoom: 8 - id: trees @@ -2575,25 +2558,7 @@ Layer: ) AS admin_text properties: minzoom: 16 - - id: nature-reserve-text - geometry: linestring - <<: *extents - Datasource: - <<: *osm2pgsql - table: |- - (SELECT - way, - name, - way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels - FROM planet_osm_polygon - WHERE (boundary = 'national_park' - OR leisure = 'nature_reserve' - OR (boundary = 'protected_area' AND tags->'protect_class' IN ('1','1a','1b','2','3','4','5','6','7','97','98','99'))) - AND name IS NOT NULL - ) AS nature_reserve_text - properties: - minzoom: 13 - - id: aboriginal-lands-text + - id: protected-areas-text geometry: linestring <<: *extents Datasource: @@ -2605,9 +2570,11 @@ Layer: way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels FROM planet_osm_polygon WHERE (boundary = 'aboriginal_lands' - OR (boundary = 'protected_area' AND tags->'protect_class' = '24')) + OR boundary = 'national_park' + OR leisure = 'nature_reserve' + OR (boundary = 'protected_area' AND tags->'protect_class' IN ('1','1a','1b','2','3','4','5','6','7','24','97','98','99'))) AND name IS NOT NULL - ) AS aboriginal_lands_text + ) AS protected_areas_text properties: minzoom: 13 - id: amenity-low-priority From b092a2d33dc451fc14959b9106f27ffdbdb8dfb4 Mon Sep 17 00:00:00 2001 From: Alan McConchie Date: Mon, 28 Jan 2019 11:41:12 -0800 Subject: [PATCH 3/5] fix bug where necessary columns were missing from protected-areas-text --- project.mml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/project.mml b/project.mml index 19aa5f9622..e89a85b401 100644 --- a/project.mml +++ b/project.mml @@ -2567,6 +2567,8 @@ Layer: (SELECT way, name, + boundary, + tags->'protect_class' AS class, way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels FROM planet_osm_polygon WHERE (boundary = 'aboriginal_lands' From a3f0c2775e4ec58539e6a92e87e4bdeb4be37eaa Mon Sep 17 00:00:00 2001 From: Alan McConchie Date: Mon, 28 Jan 2019 17:21:29 -0800 Subject: [PATCH 4/5] fix label color for boundary=protected_area + protect_class=24 --- project.mml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/project.mml b/project.mml index e89a85b401..58a505ff1a 100644 --- a/project.mml +++ b/project.mml @@ -2066,8 +2066,9 @@ Layer: 'water', 'bay', 'strait', 'cape') THEN "natural" ELSE NULL END, 'place_' || CASE WHEN place IN ('island') THEN place ELSE NULL END, - 'boundary_' || CASE WHEN boundary IN ('aboriginal_lands', 'national_park') - OR (boundary = 'protected_area' AND tags->'protect_class' IN ('1','1a','1b','2','3','4','5','6','7','24','97','98','99')) + 'boundary_' || CASE WHEN (boundary = 'protected_area' AND tags->'protect_class' = '24') THEN 'aboriginal_lands' + WHEN boundary IN ('aboriginal_lands', 'national_park') + OR (boundary = 'protected_area' AND tags->'protect_class' IN ('1','1a','1b','2','3','4','5','6','7','97','98','99')) THEN boundary ELSE NULL END, 'leisure_' || CASE WHEN leisure IN ('nature_reserve') THEN leisure ELSE NULL END ) AS feature, @@ -2150,8 +2151,9 @@ Layer: 'historic_' || CASE WHEN historic IN ('memorial', 'monument', 'archaeological_site', 'fort', 'castle', 'manor', 'city_gate') THEN historic ELSE NULL END, 'highway_' || CASE WHEN highway IN ('services', 'rest_area', 'bus_stop', 'elevator') THEN highway ELSE NULL END, - 'boundary_' || CASE WHEN boundary IN ('aboriginal_lands', 'national_park') - OR (boundary = 'protected_area' AND tags->'protect_class' IN ('1','1a','1b','2','3','4','5','6','7','24','97','98','99')) + 'boundary_' || CASE WHEN (boundary = 'protected_area' AND tags->'protect_class' = '24') THEN 'aboriginal_lands' + WHEN boundary IN ('aboriginal_lands', 'national_park') + OR (boundary = 'protected_area' AND tags->'protect_class' IN ('1','1a','1b','2','3','4','5','6','7','97','98','99')) THEN boundary ELSE NULL END, 'waterway_' || CASE WHEN waterway IN ('dam', 'dock') THEN waterway ELSE NULL END, 'tourism_' || CASE WHEN tourism IN ('viewpoint', 'attraction') THEN tourism ELSE NULL END From 8b2c536545233b5d3d38221217b9af11121d6bfc Mon Sep 17 00:00:00 2001 From: Alan McConchie Date: Mon, 28 Jan 2019 22:58:02 -0800 Subject: [PATCH 5/5] code cleanup #3521 more code cleanup more code cleanup --- admin.mss | 10 +++++----- amenity-points.mss | 4 +--- project.mml | 19 ++++++++----------- 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/admin.mss b/admin.mss index 8dda2a1e65..680a91169c 100644 --- a/admin.mss +++ b/admin.mss @@ -225,7 +225,7 @@ overlapping borders correctly. text-face-name: @book-fonts; text-fill: green; [boundary='aboriginal_lands'], - [class='24'] { + [boundary='protected_area'][protect_class='24'] { text-fill: @aboriginal; } text-halo-radius: @standard-halo-radius; @@ -247,7 +247,7 @@ overlapping borders correctly. opacity: 0.05; polygon-fill: green; [boundary='aboriginal_lands'], - [class='24'] { + [boundary='protected_area'][protect_class='24'] { polygon-fill: @aboriginal; } } @@ -256,7 +256,7 @@ overlapping borders correctly. line-width: 1.2; line-color: green; [boundary='aboriginal_lands'], - [class='24'] { + [boundary='protected_area'][protect_class='24'] { line-color: @aboriginal; } [zoom >= 9] { @@ -271,7 +271,7 @@ overlapping borders correctly. line-offset: -0.9; line-color: green; [boundary='aboriginal_lands'], - [class='24'] { + [boundary='protected_area'][protect_class='24'] { line-color: @aboriginal; } line-join: round; @@ -290,7 +290,7 @@ overlapping borders correctly. line-width: 1.8; line-color: green; [boundary='aboriginal_lands'], - [class='24'] { + [boundary='protected_area'][protect_class='24'] { line-color: @aboriginal; } line-join: round; diff --git a/amenity-points.mss b/amenity-points.mss index e1f8495531..c650ee8ba0 100644 --- a/amenity-points.mss +++ b/amenity-points.mss @@ -23,7 +23,6 @@ @aboriginal: #82643a; @religious-icon: #000000; - @landcover-font-size: 10; @landcover-wrap-width-size: 30; // 3 em @landcover-line-spacing-size: -1.5; // -0.15 em @@ -2314,8 +2313,7 @@ [feature = 'landuse_military'] { text-fill: darken(@military, 40%); } - [feature = 'boundary_aboriginal_lands'], - [feature = 'boundary_protected_area'] { + [feature = 'boundary_aboriginal_lands'] { text-fill: @aboriginal; } [feature = 'natural_wood'], diff --git a/project.mml b/project.mml index 58a505ff1a..40f39fa682 100644 --- a/project.mml +++ b/project.mml @@ -1241,13 +1241,12 @@ Layer: way, name, boundary, - tags->'protect_class' AS class, + tags->'protect_class' AS protect_class, way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels FROM planet_osm_polygon - WHERE (boundary = 'aboriginal_lands' - OR boundary = 'national_park' - OR leisure = 'nature_reserve' - OR (boundary = 'protected_area' AND tags->'protect_class' IN ('1','1a','1b','2','3','4','5','6','7','24','97','98','99'))) + WHERE (boundary IN ('aboriginal_lands', 'national_park') + OR leisure = 'nature_reserve' + OR (boundary = 'protected_area' AND tags->'protect_class' IN ('1','1a','1b','2','3','4','5','6','7','24','97','98','99'))) AND building IS NULL AND way_area > 1*!pixel_width!::real*!pixel_height!::real ) AS protected_areas @@ -2065,7 +2064,6 @@ Layer: 'natural_' || CASE WHEN "natural" IN ('wood', 'glacier', 'sand', 'scree', 'shingle', 'bare_rock', 'water', 'bay', 'strait', 'cape') THEN "natural" ELSE NULL END, 'place_' || CASE WHEN place IN ('island') THEN place ELSE NULL END, - 'boundary_' || CASE WHEN (boundary = 'protected_area' AND tags->'protect_class' = '24') THEN 'aboriginal_lands' WHEN boundary IN ('aboriginal_lands', 'national_park') OR (boundary = 'protected_area' AND tags->'protect_class' IN ('1','1a','1b','2','3','4','5','6','7','97','98','99')) @@ -2570,13 +2568,12 @@ Layer: way, name, boundary, - tags->'protect_class' AS class, + tags->'protect_class' AS protect_class, way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels FROM planet_osm_polygon - WHERE (boundary = 'aboriginal_lands' - OR boundary = 'national_park' - OR leisure = 'nature_reserve' - OR (boundary = 'protected_area' AND tags->'protect_class' IN ('1','1a','1b','2','3','4','5','6','7','24','97','98','99'))) + WHERE (boundary IN ('aboriginal_lands', 'national_park') + OR leisure = 'nature_reserve' + OR (boundary = 'protected_area' AND tags->'protect_class' IN ('1','1a','1b','2','3','4','5','6','7','24','97','98','99'))) AND name IS NOT NULL ) AS protected_areas_text properties: