Skip to content

Commit

Permalink
Additional access marking (#5049)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
dch0ph authored Jan 16, 2025
1 parent adff4bd commit 248b72d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
3 changes: 2 additions & 1 deletion functions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
22 changes: 16 additions & 6 deletions style/roads.mss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 248b72d

Please sign in to comment.