From 5ca0187d94b9744ad0674e3cd39a776e2037f00d Mon Sep 17 00:00:00 2001 From: dch0ph Date: Mon, 30 Dec 2024 15:41:49 +0000 Subject: [PATCH 1/4] Restricted marking for motorway/trunk/primary --- style/roads.mss | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/style/roads.mss b/style/roads.mss index 84da2dba0..08ddb556e 100644 --- a/style/roads.mss +++ b/style/roads.mss @@ -3397,6 +3397,9 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */ #roads-fill::fill, #bridges::fill { [int_access = 'restricted'] { + [feature = 'highway_motorway'], + [feature = 'highway_trunk'], + [feature = 'highway_primary'], [feature = 'highway_secondary'], [feature = 'highway_tertiary'], [feature = 'highway_unclassified'], @@ -3407,6 +3410,9 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */ [int_surface = 'unpaved'] { access/line-color: @access-marking-white-unpaved; } + [feature = 'highway_primary'] { + access/line-color: @access-marking-primary; + } [feature = 'highway_secondary'] { access/line-color: @access-marking-secondary; } From 39253f107faaf148eb4f17f9d69ce1a5607ed6d4 Mon Sep 17 00:00:00 2001 From: dch0ph Date: Mon, 30 Dec 2024 15:56:09 +0000 Subject: [PATCH 2/4] Add access marking for highway=pedestrian --- style/roads.mss | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/style/roads.mss b/style/roads.mss index 08ddb556e..b13f19676 100644 --- a/style/roads.mss +++ b/style/roads.mss @@ -27,6 +27,7 @@ @access-marking-secondary: #e4e4e4; @access-marking-white-unpaved: #e0e0e0; @access-marking-road: #f0f0f0; +@access-marking-pedestrian: white; @access-marking-living-street: #d4d4d4; @default-casing: white; @@ -3404,6 +3405,7 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */ [feature = 'highway_tertiary'], [feature = 'highway_unclassified'], [feature = 'highway_residential'], + [feature = 'highway_pedestrian'], [feature = 'highway_living_street'] { [zoom >= 15] { access/line-color: @access-marking; @@ -3416,6 +3418,9 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */ [feature = 'highway_secondary'] { access/line-color: @access-marking-secondary; } + [feature = 'highway_pedestrian'] { + access/line-color: @access-marking-pedestrian; + } [feature = 'highway_living_street'] { access/line-color: @access-marking-living-street; } @@ -3473,6 +3478,7 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */ [feature = 'highway_tertiary'], [feature = 'highway_unclassified'], [feature = 'highway_residential'], + [feature = 'highway_pedestrian'], [feature = 'highway_living_street'] { [zoom >= 15] { access/line-color: @access-marking; @@ -3489,6 +3495,9 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */ [feature = 'highway_secondary'] { access/line-color: @access-marking-secondary; } + [feature = 'highway_pedestrian'] { + access/line-color: @access-marking-pedestrian; + } [feature = 'highway_living_street'] { access/line-color: @access-marking-living-street; } From 9432d9f74083a1621358fcfb6342cbe2dc64f2cd Mon Sep 17 00:00:00 2001 From: dch0ph Date: Mon, 30 Dec 2024 16:36:52 +0000 Subject: [PATCH 3/4] Update functions.sql highway=pedestrian should support restricted access --- functions.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/functions.sql b/functions.sql index 8b0d62176..4e8ad7030 100644 --- a/functions.sql +++ b/functions.sql @@ -66,7 +66,8 @@ SELECT WHEN 'bridleway' THEN carto_int_access(horse, FALSE) ELSE carto_int_access(COALESCE(NULLIF(foot, 'unknown'), "access"), FALSE) END - WHEN highway IN ('pedestrian', 'footway', 'steps') THEN carto_int_access(COALESCE(NULLIF(foot, 'unknown'), "access"), FALSE) + WHEN highway = 'pedestrian' THEN carto_int_access(COALESCE(NULLIF(foot, 'unknown'), "access"), TRUE) + WHEN highway IN ('footway', 'steps') THEN carto_int_access(COALESCE(NULLIF(foot, 'unknown'), "access"), FALSE) WHEN highway = 'cycleway' THEN carto_int_access(COALESCE(NULLIF(bicycle, 'unknown'), "access"), FALSE) WHEN highway = 'bridleway' THEN carto_int_access(COALESCE(NULLIF(horse, 'unknown'), "access"), FALSE) ELSE carto_int_access("access", TRUE) From f5a8888ed1495e5e7b639b905bf6c693d8a2c268 Mon Sep 17 00:00:00 2001 From: dch0ph Date: Tue, 14 Jan 2025 18:48:19 +0000 Subject: [PATCH 4/4] Change pedestrian access marking colour Change pedestrian access marking colour to common light shade of grey. Also consolidate names. --- style/roads.mss | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/style/roads.mss b/style/roads.mss index b13f19676..bbfabb4dc 100644 --- a/style/roads.mss +++ b/style/roads.mss @@ -23,11 +23,10 @@ @taxiway-fill: @aeroway-fill; @helipad-fill: @aeroway-fill; @access-marking: #eaeaea; -@access-marking-primary: #f0f0f0; +/* access-marking-light is used on some darker highways for better contrast */ +@access-marking-light: #f0f0f0; @access-marking-secondary: #e4e4e4; @access-marking-white-unpaved: #e0e0e0; -@access-marking-road: #f0f0f0; -@access-marking-pedestrian: white; @access-marking-living-street: #d4d4d4; @default-casing: white; @@ -3412,15 +3411,13 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */ [int_surface = 'unpaved'] { access/line-color: @access-marking-white-unpaved; } - [feature = 'highway_primary'] { - access/line-color: @access-marking-primary; + [feature = 'highway_primary'], + [feature = 'highway_pedestrian'] { + access/line-color: @access-marking-light; } [feature = 'highway_secondary'] { access/line-color: @access-marking-secondary; } - [feature = 'highway_pedestrian'] { - access/line-color: @access-marking-pedestrian; - } [feature = 'highway_living_street'] { access/line-color: @access-marking-living-street; } @@ -3442,7 +3439,7 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */ access/line-color: @access-marking-white-unpaved; } [feature = 'highway_road'] { - access/line-color: @access-marking-road; + access/line-color: @access-marking-light; } access/line-join: round; access/line-cap: round; @@ -3489,15 +3486,13 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */ access/line-color: @access-marking-white-unpaved; } } - [feature = 'highway_primary'] { - access/line-color: @access-marking-primary; + [feature = 'highway_primary'], + [feature = 'highway_pedestrian'] { + access/line-color: @access-marking-light; } [feature = 'highway_secondary'] { access/line-color: @access-marking-secondary; } - [feature = 'highway_pedestrian'] { - access/line-color: @access-marking-pedestrian; - } [feature = 'highway_living_street'] { access/line-color: @access-marking-living-street; } @@ -3519,7 +3514,7 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */ access/line-color: @access-marking-white-unpaved; } [feature = 'highway_road'] { - access/line-color: @access-marking-road; + access/line-color: @access-marking-light; } access/line-join: round; access/line-cap: round;