diff --git a/landcover.mss b/landcover.mss index c69cc338df..08c620cf49 100644 --- a/landcover.mss +++ b/landcover.mss @@ -845,18 +845,7 @@ } } -#area-barriers { - [zoom >= 16] { - line-color: #444; - line-width: 0.4; - [feature = 'barrier_hedge'] { - polygon-fill: #aed1a0; - } - } -} - -#line-barriers, -#area-barriers { +#barriers { [zoom >= 16] { line-width: 0.4; line-color: #444; diff --git a/project.mml b/project.mml index f09fa93c7c..16fe162067 100644 --- a/project.mml +++ b/project.mml @@ -573,7 +573,7 @@ Layer: ) AS tourism_boundary properties: minzoom: 10 - - id: line-barriers + - id: barriers geometry: linestring <<: *extents Datasource: @@ -581,12 +581,29 @@ Layer: table: |- (SELECT way, COALESCE(historic, barrier) AS feature - FROM (SELECT way, - ('barrier_' || (CASE WHEN barrier IN ('chain', 'city_wall', 'embankment', 'ditch', 'fence', 'guard_rail', - 'handrail', 'hedge', 'kerb', 'retaining_wall', 'wall') THEN barrier ELSE NULL END)) AS barrier, - ('historic_' || (CASE WHEN historic = 'citywalls' THEN historic ELSE NULL END)) AS historic - FROM planet_osm_line - WHERE barrier IN ('chain', 'city_wall', 'embankment', 'ditch', 'fence', 'guard_rail', + FROM + (SELECT way, + ('barrier_' || (CASE WHEN barrier IN ('chain', 'city_wall', 'embankment', 'ditch', 'fence', 'guard_rail', + 'handrail', 'hedge', 'kerb', 'retaining_wall', 'wall') THEN barrier ELSE NULL END)) AS barrier, + ('historic_' || (CASE WHEN historic = 'citywalls' THEN historic ELSE NULL END)) AS historic + FROM + (SELECT + way, + historic, + barrier, + waterway + FROM planet_osm_polygon + WHERE way && !bbox! + UNION ALL + SELECT + way, + historic, + barrier, + waterway + FROM planet_osm_line + WHERE way && !bbox! + ) _ + WHERE barrier IN ('chain', 'city_wall', 'embankment', 'ditch', 'fence', 'guard_rail', 'handrail', 'hedge', 'kerb', 'retaining_wall', 'wall') OR historic = 'citywalls' AND (waterway IS NULL OR waterway NOT IN ('river', 'canal', 'stream', 'drain', 'ditch')) @@ -608,27 +625,6 @@ Layer: properties: cache-features: true minzoom: 13 - - id: area-barriers - geometry: polygon - <<: *extents - Datasource: - <<: *osm2pgsql - table: |- - (SELECT - way, COALESCE(historic, barrier) AS feature - FROM (SELECT way, - ('barrier_' || (CASE WHEN barrier IN ('chain', 'city_wall', 'embankment', 'ditch', 'fence', 'guard_rail', - 'handrail', 'hedge', 'kerb', 'retaining_wall', 'wall') THEN barrier ELSE NULL END)) AS barrier, - ('historic_' || (CASE WHEN historic = 'citywalls' THEN historic ELSE NULL END)) AS historic - FROM planet_osm_polygon - WHERE (barrier IN ('chain', 'city_wall', 'embankment', 'ditch', 'fence', 'guard_rail', - 'handrail', 'hedge', 'kerb', 'retaining_wall', 'wall') - OR historic = 'citywalls') - AND building IS NULL - ) AS features - ) AS area_barriers - properties: - minzoom: 16 - id: ferry-routes geometry: linestring <<: *extents