From a1cdbf858c514383f785a9c117bbde5abb2c82a8 Mon Sep 17 00:00:00 2001 From: brainwad Date: Tue, 21 Jul 2020 23:01:43 +0200 Subject: [PATCH 1/3] Colour segregated sidepaths as either footways or bridleways. Currently segregated cycleways are rendered as a cycleway + a (green) path, but as the green is meant to imply cyclability, and the non-cycle portion is not cyclable, it makes sense to colour it as a bridleway or footway depending on whether or not horse traffic is allowed, respectively. --- project.mml | 9 ++++++--- roads.mss | 11 ++++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/project.mml b/project.mml index 555cfabc..b6447bb0 100644 --- a/project.mml +++ b/project.mml @@ -544,7 +544,8 @@ Layer: ELSE NULL END AS can_bicycle, CASE - WHEN tags->'segregated' IN ('yes') THEN 'yes' + WHEN tags->'segregated' = 'yes' AND (horse IN ('designated', 'yes') OR highway='bridleway' OR (highway='path' AND horse != 'no')) THEN 'horse' + WHEN tags->'segregated' = 'yes' THEN 'foot' ELSE 'no' END AS segregated, CASE @@ -721,7 +722,8 @@ Layer: ELSE NULL END AS can_bicycle, CASE - WHEN tags->'segregated' IN ('yes') THEN 'yes' + WHEN tags->'segregated' = 'yes' AND (horse IN ('designated', 'yes') OR highway='bridleway' OR (highway='path' AND horse != 'no')) THEN 'horse' + WHEN tags->'segregated' = 'yes' THEN 'foot' ELSE 'no' END AS segregated, CASE @@ -984,7 +986,8 @@ Layer: ELSE NULL END AS can_bicycle, CASE - WHEN tags->'segregated' IN ('yes') THEN 'yes' + WHEN tags->'segregated' = 'yes' AND (horse IN ('designated', 'yes') OR highway='bridleway' OR (highway='path' AND horse != 'no')) THEN 'horse' + WHEN tags->'segregated' = 'yes' THEN 'foot' ELSE 'no' END AS segregated, CASE diff --git a/roads.mss b/roads.mss index 23201b99..db450b3c 100644 --- a/roads.mss +++ b/roads.mss @@ -756,11 +756,12 @@ } -#roads_high::path_outline_right[zoom>=17][type='path'][can_bicycle='designated'][segregated='yes'], -#tunnel::path_outline_right[zoom>=17][type='path'][can_bicycle='designated'][segregated='yes'], -#bridge::path_outline_right[zoom>=17][type='path'][can_bicycle='designated'][segregated='yes'] { +#roads_high::path_outline_right[zoom>=17][type='path'][can_bicycle='designated'][segregated!='no'], +#tunnel::path_outline_right[zoom>=17][type='path'][can_bicycle='designated'][segregated!='no'], +#bridge::path_outline_right[zoom>=17][type='path'][can_bicycle='designated'][segregated!='no'] { line-cap: butt; - line-color: @path-fill; + [segregated='foot'] { line-color: @footway-fill; } + [segregated='horse'] { line-color: @bridleway-fill; } line-width: @rdz17_path; line-offset: @rdz17_path/2 + @rdz17_cycle/2; @@ -3301,7 +3302,7 @@ line-color: @mixed-cycle-fill; #tunnel { line-color: lighten(@mixed-cycle-fill, 10%); } - [segregated='yes'] { + [segregated!='no'] { line-color: @cycle-fill; #tunnel { line-color: lighten(@cycle-fill, 15%); } } From 2656f06ba03b0f9b47cfa0de2ba429b5166c9ac9 Mon Sep 17 00:00:00 2001 From: brainwad Date: Thu, 12 Nov 2020 23:11:27 +0100 Subject: [PATCH 2/3] Render segregated for non-designated paths --- roads.mss | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/roads.mss b/roads.mss index db450b3c..510f9f3b 100644 --- a/roads.mss +++ b/roads.mss @@ -756,23 +756,29 @@ } -#roads_high::path_outline_right[zoom>=17][type='path'][can_bicycle='designated'][segregated!='no'], -#tunnel::path_outline_right[zoom>=17][type='path'][can_bicycle='designated'][segregated!='no'], -#bridge::path_outline_right[zoom>=17][type='path'][can_bicycle='designated'][segregated!='no'] { +#roads_high::path_outline_right[zoom>=17][type='path'][can_bicycle!='no'][segregated!='no'], +#tunnel::path_outline_right[zoom>=17][type='path'][can_bicycle!='no'][segregated!='no'], +#bridge::path_outline_right[zoom>=17][type='path'][can_bicycle!='no'][segregated!='no'] { line-cap: butt; [segregated='foot'] { line-color: @footway-fill; } [segregated='horse'] { line-color: @bridleway-fill; } line-width: @rdz17_path; - line-offset: @rdz17_path/2 + @rdz17_cycle/2; - [oneway='no'][oneway_bicycle='no'] { - line-width: @rdz17_path; line-offset: @rdz17_path/2 + @rdz17_cycle*1.5/2; + line-offset: @rdz17_path; + [can_bicycle='designated'] { + line-offset: @rdz17_path/2 + @rdz17_cycle/2; + [oneway='no'][oneway_bicycle='no'] { + line-width: @rdz17_path; line-offset: @rdz17_path/2 + @rdz17_cycle*1.5/2; + } } [zoom>=18] { line-width: @rdz18_path; - line-offset: @rdz18_path/2 + @rdz18_cycle/2; - [oneway='no'][oneway_bicycle='no']{ - line-width: @rdz18_path; line-offset: @rdz18_path/2 + @rdz18_cycle*1.5/2; + line-offset: @rdz18_path; + [can_bicycle='designated'] { + line-offset: @rdz18_path/2 + @rdz18_cycle/2; + [oneway='no'][oneway_bicycle='no']{ + line-width: @rdz18_path; line-offset: @rdz18_path/2 + @rdz18_cycle*1.5/2; + } } } } From 6ec44f02767f2de1735f1d83995b1db6662cfdd7 Mon Sep 17 00:00:00 2001 From: brainwad Date: Fri, 13 Nov 2020 12:47:13 +0100 Subject: [PATCH 3/3] Make footway-fill default colour for segregated sidepaths --- roads.mss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roads.mss b/roads.mss index 510f9f3b..0144c501 100644 --- a/roads.mss +++ b/roads.mss @@ -760,7 +760,7 @@ #tunnel::path_outline_right[zoom>=17][type='path'][can_bicycle!='no'][segregated!='no'], #bridge::path_outline_right[zoom>=17][type='path'][can_bicycle!='no'][segregated!='no'] { line-cap: butt; - [segregated='foot'] { line-color: @footway-fill; } + line-color: @footway-fill; [segregated='horse'] { line-color: @bridleway-fill; } line-width: @rdz17_path;