From d4fe6baac44cede1978fe618fd4c295ed218b9d0 Mon Sep 17 00:00:00 2001 From: dch0ph Date: Sat, 12 Oct 2024 18:07:40 +0100 Subject: [PATCH 1/2] Move leisure=track Move leisure=track and attraction=water_slides from amenity-line to landcover-line --- project.mml | 24 +++++++++++------- style/amenity-points.mss | 36 -------------------------- style/landcover.mss | 55 +++++++++++++++++++++++++++++++++------- 3 files changed, 61 insertions(+), 54 deletions(-) diff --git a/project.mml b/project.mml index fe1348816..4cb5e6968 100644 --- a/project.mml +++ b/project.mml @@ -151,9 +151,17 @@ Layer: <<: *osm2pgsql table: |- (SELECT - way + way, + COALESCE( + 'leisure_' || CASE WHEN leisure = 'track' THEN 'track' END, + 'attraction_' || CASE WHEN tags @> 'attraction=>water_slide' THEN 'water_slide' END, + 'man_made_' || CASE WHEN man_made = 'cutline' THEN 'cutline' END + ) AS feature FROM planet_osm_line - WHERE man_made = 'cutline' + WHERE leisure = 'track' + OR tags @> 'attraction=>water_slide' + OR man_made = 'cutline' + ORDER BY COALESCE(layer,0) ) AS landcover_line properties: minzoom: 14 @@ -1772,15 +1780,13 @@ Layer: (SELECT way, COALESCE( - 'highway_' || CASE WHEN tags @> 'ford=>yes' OR tags @> 'ford=>stepping_stones' THEN 'ford' END, - 'leisure_' || CASE WHEN leisure IN ('slipway', 'track') THEN leisure END, - 'attraction_' || CASE WHEN tags @> 'attraction=>water_slide' THEN 'water_slide' END - ) AS feature + 'highway_' || CASE WHEN tags -> 'ford' IN ('yes', 'stepping_stones') THEN 'ford' END, + 'leisure_' || CASE WHEN leisure IN ('slipway') THEN leisure END + ) AS feature, FROM planet_osm_line -- The upcoming where clause is needed for performance only, as the CASE statements would end up doing the equivalent filtering - WHERE tags @> 'ford=>yes' OR tags @> 'ford=>stepping_stones' - OR leisure IN ('slipway', 'track') - OR tags @> 'attraction=>water_slide' + WHERE tags -> 'ford' IN ('yes', 'stepping_stones') + OR leisure = 'slipway' ORDER BY COALESCE(layer,0) ) AS amenity_line properties: diff --git a/style/amenity-points.mss b/style/amenity-points.mss index d8db77283..322e8ee65 100644 --- a/style/amenity-points.mss +++ b/style/amenity-points.mss @@ -3006,42 +3006,6 @@ marker-file: url('symbols/leisure/slipway.svg'); marker-fill: @transportation-icon; } - - [feature = 'leisure_track'] { - [zoom >= 16] { - [zoom >= 17] { - bridgecasing/line-color: saturate(darken(@pitch, 30%), 20%); - bridgecasing/line-join: round; - bridgecasing/line-width: 1.25; - [zoom >= 18] { bridgecasing/line-width: 2.5; } - [zoom >= 19] { bridgecasing/line-width: 5; } - } - line-color: @pitch; - line-join: round; - line-cap: round; - line-width: 1; - [zoom >= 18] { line-width: 2; } - [zoom >= 19] { line-width: 4; } - } - } - - [feature = 'attraction_water_slide'] { - [zoom >= 16] { - [zoom >= 17] { - bridgecasing/line-color: black; - bridgecasing/line-join: round; - bridgecasing/line-width: 1.25; - [zoom >= 18] { bridgecasing/line-width: 2.5; } - [zoom >= 19] { bridgecasing/line-width: 5; } - } - line-color: @pitch; - line-join: round; - line-cap: round; - line-width: 1; - [zoom >= 18] { line-width: 2; } - [zoom >= 19] { line-width: 4; } - } - } } #text-line { diff --git a/style/landcover.mss b/style/landcover.mss index 46dc79bdd..48e4324f1 100644 --- a/style/landcover.mss +++ b/style/landcover.mss @@ -724,18 +724,55 @@ } } -/* man_made=cutline */ #landcover-line { - [zoom >= 14] { - line-width: 3; - line-join: round; - line-cap: square; - line-color: @grass; + [feature = 'man_made_cutline'] { + [zoom >= 14] { + line-width: 3; + line-join: round; + line-cap: square; + line-color: @grass; + [zoom >= 16] { + line-width: 6; + [zoom >= 18] { + line-width: 12; + } + } + } + } + + [feature = 'leisure_track'] { + [zoom >= 16] { + [zoom >= 17] { + bridgecasing/line-color: saturate(darken(@pitch, 30%), 20%); + bridgecasing/line-join: round; + bridgecasing/line-width: 1.25; + [zoom >= 18] { bridgecasing/line-width: 2.5; } + [zoom >= 19] { bridgecasing/line-width: 5; } + } + line-color: @pitch; + line-join: round; + line-cap: round; + line-width: 1; + [zoom >= 18] { line-width: 2; } + [zoom >= 19] { line-width: 4; } + } + } + + [feature = 'attraction_water_slide'] { [zoom >= 16] { - line-width: 6; - [zoom >= 18] { - line-width: 12; + [zoom >= 17] { + bridgecasing/line-color: black; + bridgecasing/line-join: round; + bridgecasing/line-width: 1.25; + [zoom >= 18] { bridgecasing/line-width: 2.5; } + [zoom >= 19] { bridgecasing/line-width: 5; } } + line-color: @pitch; + line-join: round; + line-cap: round; + line-width: 1; + [zoom >= 18] { line-width: 2; } + [zoom >= 19] { line-width: 4; } } } } From f6cd16839a38468cac7baa4d4442590cc37a63c2 Mon Sep 17 00:00:00 2001 From: dch0ph Date: Sat, 12 Oct 2024 20:40:58 +0100 Subject: [PATCH 2/2] [fixup] --- project.mml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project.mml b/project.mml index 4cb5e6968..39b375fa0 100644 --- a/project.mml +++ b/project.mml @@ -1782,7 +1782,7 @@ Layer: COALESCE( 'highway_' || CASE WHEN tags -> 'ford' IN ('yes', 'stepping_stones') THEN 'ford' END, 'leisure_' || CASE WHEN leisure IN ('slipway') THEN leisure END - ) AS feature, + ) AS feature FROM planet_osm_line -- The upcoming where clause is needed for performance only, as the CASE statements would end up doing the equivalent filtering WHERE tags -> 'ford' IN ('yes', 'stepping_stones')