From 248b72d6b27cdb516b6dfb00f1820240389ccc18 Mon Sep 17 00:00:00 2001 From: dch0ph Date: Thu, 16 Jan 2025 20:41:58 +0000 Subject: [PATCH] Additional access marking (#5049) * Restricted marking for motorway/trunk/primary * Add access marking for highway=pedestrian * Update functions.sql highway=pedestrian should support restricted access * Change pedestrian access marking colour Change pedestrian access marking colour to common light shade of grey. Also consolidate names. --- functions.sql | 3 ++- style/roads.mss | 22 ++++++++++++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) 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) diff --git a/style/roads.mss b/style/roads.mss index 84da2dba0..bbfabb4dc 100644 --- a/style/roads.mss +++ b/style/roads.mss @@ -23,10 +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-living-street: #d4d4d4; @default-casing: white; @@ -3397,16 +3397,24 @@ 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'], [feature = 'highway_residential'], + [feature = 'highway_pedestrian'], [feature = 'highway_living_street'] { [zoom >= 15] { access/line-color: @access-marking; [int_surface = 'unpaved'] { access/line-color: @access-marking-white-unpaved; } + [feature = 'highway_primary'], + [feature = 'highway_pedestrian'] { + access/line-color: @access-marking-light; + } [feature = 'highway_secondary'] { access/line-color: @access-marking-secondary; } @@ -3431,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; @@ -3467,6 +3475,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; @@ -3477,8 +3486,9 @@ 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; @@ -3504,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;