From 2455ab938577361a9390a4647ba38fd4739e40de Mon Sep 17 00:00:00 2001 From: Jeroen Hoek Date: Wed, 1 Sep 2021 20:39:07 +0200 Subject: [PATCH] Render highway=busway Initial fix for #4226. Rendering is kept close to `highway=service` for this initial rendering of a hitherto unrendered feature. The only digression from `highway=service` is a distinctive colour based on the `highway=bus_guideway` colour proposed in PR #4395. --- openstreetmap-carto.lua | 1 + project.mml | 12 ++-- style/roads.mss | 143 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 151 insertions(+), 5 deletions(-) diff --git a/openstreetmap-carto.lua b/openstreetmap-carto.lua index 8dbca62a64..90666b1b97 100644 --- a/openstreetmap-carto.lua +++ b/openstreetmap-carto.lua @@ -198,6 +198,7 @@ local roads_info = { living_street = {z = 320, roads = false}, pedestrian = {z = 310, roads = false}, raceway = {z = 300, roads = false}, + busway = {z = 330, roads = false}, motorway_link = {z = 240, roads = true}, trunk_link = {z = 230, roads = true}, primary_link = {z = 220, roads = true}, diff --git a/project.mml b/project.mml index 05a126cef4..65b59e7d02 100644 --- a/project.mml +++ b/project.mml @@ -645,8 +645,9 @@ Layer: ('unclassified', 4), ('residential', 5), ('living_street', 6), - ('service', 7), - ('track', 8) + ('busway', 7), + ('service', 8), + ('track', 9) ) AS v (highway, prio) ON v.highway = l.highway WHERE p.highway IN ( @@ -1843,7 +1844,7 @@ Layer: horse, bicycle FROM planet_osm_line l WHERE highway IN ('motorway', 'motorway_link', 'trunk', 'trunk_link', 'primary', 'primary_link', 'secondary', 'secondary_link', 'tertiary', - 'tertiary_link', 'residential', 'unclassified', 'road', 'service', 'pedestrian', 'raceway', 'living_street', 'construction') + 'tertiary_link', 'residential', 'unclassified', 'road', 'service', 'busway', 'pedestrian', 'raceway', 'living_street', 'construction') AND (name IS NOT NULL OR oneway IN ('yes', '-1') OR junction IN ('roundabout')) @@ -1938,10 +1939,10 @@ Layer: SELECT osm_id, way, - CASE WHEN highway IN ('unclassified', 'residential', 'track') THEN highway END AS highway, + CASE WHEN highway IN ('unclassified', 'residential', 'track', 'busway') THEN highway END AS highway, string_to_array(ref, ';') AS refs FROM planet_osm_line - WHERE highway IN ('unclassified', 'residential', 'track') + WHERE highway IN ('unclassified', 'residential', 'track', 'busway') AND ref IS NOT NULL ) AS p) AS q WHERE height <= 4 AND width <= 11 @@ -1949,6 +1950,7 @@ Layer: CASE WHEN highway = 'unclassified' THEN 33 WHEN highway = 'residential' THEN 32 + WHEN highway = 'busway' THEN 31 WHEN highway = 'track' THEN 30 END DESC NULLS LAST, height DESC, diff --git a/style/roads.mss b/style/roads.mss index c750ba2b97..815a4748d9 100644 --- a/style/roads.mss +++ b/style/roads.mss @@ -3,6 +3,7 @@ @tertiary-fill: #ffffff; @residential-fill: #ffffff; @service-fill: @residential-fill; +@busway-fill: #f2eef9; @living-street-fill: #ededed; @pedestrian-fill: #dddde8; @raceway-fill: pink; @@ -23,12 +24,14 @@ @helipad-fill: @aeroway-fill; @access-marking: #eaeaea; @access-marking-living-street: #cccccc; +@access-marking-busway: #cbbce6; @default-casing: white; @tertiary-casing: #8f8f8f; @residential-casing: #bbb; @road-casing: @residential-casing; @service-casing: @residential-casing; +@busway-casing: #b099d9; @living-street-casing: @residential-casing; @pedestrian-casing: #999; @path-casing: @default-casing; @@ -126,6 +129,7 @@ @pedestrian-width-z14: 3; @road-width-z14: 2; @service-width-z14: 2; +@busway-width-z14: 2; @steps-width-z14: 0.7; @motorway-width-z15: 10; @@ -156,6 +160,7 @@ @pedestrian-width-z16: 6; @road-width-z16: 3.5; @service-width-z16: 3.5; +@busway-width-z16: 3.5; @minor-service-width-z16: 2; @footway-width-z16: 1.3; @cycleway-width-z16: 0.9; @@ -175,6 +180,7 @@ @pedestrian-width-z17: 12; @road-width-z17: 7; @service-width-z17: 7; +@busway-width-z17: 7; @minor-service-width-z17: 3.5; @motorway-width-z18: 21; @@ -192,6 +198,7 @@ @pedestrian-width-z18: 13; @road-width-z18: 8.5; @service-width-z18: 8.5; +@busway-width-z18: 8.5; @minor-service-width-z18: 4.75; @footway-width-z18: 1.3; @cycleway-width-z18: 1; @@ -211,6 +218,7 @@ @pedestrian-width-z19: 17; @road-width-z19: 11; @service-width-z19: 11; +@busway-width-z19: 11; @minor-service-width-z19: 5.5; @footway-width-z19: 1.6; @cycleway-width-z19: 1.3; @@ -218,6 +226,7 @@ @motorway-width-z20: 33; @motorway-link-width-z20: 17; @service-width-z20: 12; +@busway-width-z20: 12; @minor-service-width-z20: 8.5; @@ -298,6 +307,7 @@ @residential-oneway-arrow-color: darken(@residential-casing, 40%); @living-street-oneway-arrow-color: darken(@residential-casing, 30%); @pedestrian-oneway-arrow-color: darken(@pedestrian-casing, 25%); +@busway-oneway-arrow-color: darken(@busway-fill, 30%); @raceway-oneway-arrow-color: darken(@raceway-fill, 50%); @footway-oneway-arrow-color: darken(@footway-fill, 35%); @steps-oneway-arrow-color: darken(@steps-fill, 35%); @@ -552,6 +562,29 @@ } } + [feature = 'highway_busway'] { + [zoom >= 14] { + line-color: @busway-casing; + line-width: @service-width-z14; + [zoom >= 16] { line-width: @busway-width-z16; } + [zoom >= 17] { line-width: @busway-width-z17; } + [zoom >= 18] { line-width: @busway-width-z18; } + [zoom >= 19] { line-width: @busway-width-z19; } + [zoom >= 20] { line-width: @busway-width-z20; } + #roads-casing { + line-join: round; + line-cap: round; + } + #tunnels { + line-dasharray: 4,2; + } + #bridges { + line-color: @bridge-casing; + line-join: round; + } + } + } + [feature = 'highway_service'] { [zoom >= 14][service = 'INT-normal'], [zoom >= 16][service = 'INT-minor'] { @@ -1282,6 +1315,27 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */ } } + [construction = 'busway'][zoom >= 15] { + line-color: @busway-fill; + b/line-color: white; + b/line-dasharray: 6,4; + line-width: @busway-width-z14; + b/line-width: @busway-width-z14; + [zoom >= 16] { + line-width: @busway-width-z16; + b/line-width: @busway-width-z16 - 2 * @casing-width-z16; + b/line-dasharray: 8,6; + } + [zoom >= 17] { + line-width: @busway-width-z17; + b/line-width: @busway-width-z17 - 2 * @casing-width-z17; + } + [zoom >= 18] { + line-width: 8; + b/line-width: 7 + } + } + [construction = 'service'] { [zoom >= 15][service = 'INT-normal'], [zoom >= 17][service = 'INT-minor'] { @@ -1713,6 +1767,31 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */ } } + [feature = 'highway_busway'] { + [zoom >= 14] { + line-color: @busway-fill; + line-width: @busway-width-z14 - 2 * @casing-width-z14; + [zoom >= 16] { line-width: @busway-width-z16 - 2 * @casing-width-z16; } + [zoom >= 17] { line-width: @busway-width-z17 - 2 * @casing-width-z17; } + [zoom >= 18] { line-width: @busway-width-z18 - 2 * @casing-width-z18; } + [zoom >= 19] { line-width: @busway-width-z19 - 2 * @casing-width-z19; } + [zoom >= 20] { line-width: @busway-width-z20 - 2 * @casing-width-z20; } + line-join: round; + line-cap: round; + #tunnels { + line-color: darken(white, 5%); + } + #bridges { + line-width: @busway-width-z14 - 2 * @bridge-casing-width-z14; + [zoom >= 16] { line-width: @busway-width-z16 - 2 * @bridge-casing-width-z16; } + [zoom >= 17] { line-width: @busway-width-z17 - 2 * @bridge-casing-width-z17; } + [zoom >= 18] { line-width: @busway-width-z18 - 2 * @bridge-casing-width-z18; } + [zoom >= 19] { line-width: @busway-width-z19 - 2 * @bridge-casing-width-z19; } + [zoom >= 20] { line-width: @busway-width-z20 - 2 * @bridge-casing-width-z20; } + } + } + } + [feature = 'highway_service'] { [zoom >= 14][service = 'INT-normal'], [zoom >= 16][service = 'INT-minor'] { @@ -2437,6 +2516,31 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */ marker-line-width: 0; } + [int_tc_type = 'busway'][zoom >= 16] { + marker-fill: @busway-casing; + marker-width: @busway-width-z16 * 1.6 + 2 * @casing-width-z16; + marker-height: @busway-width-z16 * 1.6 + 2 * @casing-width-z16; + [zoom >= 17] { + marker-width: @busway-width-z17 * 1.6 + 2 * @casing-width-z17; + marker-height: @busway-width-z17 * 1.6 + 2 * @casing-width-z17; + } + [zoom >= 18] { + marker-width: @busway-width-z18 * 1.6 + 2 * @casing-width-z18; + marker-height: @busway-width-z18 * 1.6 + 2 * @casing-width-z18; + } + [zoom >= 19] { + marker-width: @busway-width-z19 * 1.6 + 2 * @casing-width-z19; + marker-height: @busway-width-z19 * 1.6 + 2 * @casing-width-z19; + } + [zoom >= 20] { + marker-width: @busway-width-z20 * 1.6 + 2 * @casing-width-z20; + marker-height: @busway-width-z20 * 1.6 + 2 * @casing-width-z20; + } + marker-allow-overlap: true; + marker-ignore-placement: true; + marker-line-width: 0; + } + [int_tc_type = 'service'][int_tc_service = 'INT-normal'][zoom >= 16] { marker-fill: @service-casing; marker-width: @service-width-z16 * 1.6 + 2 * @casing-width-z16; @@ -2605,6 +2709,31 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */ marker-line-width: 0; } + [int_tc_type = 'busway'][zoom >= 16] { + marker-fill: @busway-fill; + marker-width: @busway-width-z16 * 1.6; + marker-height: @busway-width-z16 * 1.6; + [zoom >= 17] { + marker-width: @busway-width-z17 * 1.6; + marker-height: @busway-width-z17 * 1.6; + } + [zoom >= 18] { + marker-width: @busway-width-z18 * 1.6; + marker-height: @busway-width-z18 * 1.6; + } + [zoom >= 19] { + marker-width: @busway-width-z19 * 1.6; + marker-height: @busway-width-z19 * 1.6; + } + [zoom >= 20] { + marker-width: @busway-width-z20 * 1.6; + marker-height: @busway-width-z20 * 1.6; + } + marker-allow-overlap: true; + marker-ignore-placement: true; + marker-line-width: 0; + } + [int_tc_type = 'service'][int_tc_service = 'INT-normal'][zoom >= 16] { marker-fill: @service-fill; marker-width: @service-width-z16 * 1.6; @@ -2864,9 +2993,13 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */ } } [feature = 'highway_road'], + [feature = 'highway_busway'], [feature = 'highway_service'][service = 'INT-normal'] { [zoom >= 15] { access/line-color: @access-marking; + [feature = 'highway_busway'] { + access/line-color: @access-marking-busway; + } access/line-join: round; access/line-cap: round; access/line-width: 2; @@ -2915,9 +3048,13 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */ } } [feature = 'highway_road'], + [feature = 'highway_busway'], [feature = 'highway_service'][service = 'INT-normal'] { [zoom >= 15] { access/line-color: @access-marking; + [feature = 'highway_busway'] { + access/line-color: @access-marking-busway; + } access/line-join: round; access/line-cap: round; access/line-width: 2; @@ -3338,6 +3475,7 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */ } [highway = 'raceway'], + [highway = 'busway'], [highway = 'service'], [highway = 'construction'][construction = 'raceway'], [highway = 'construction'][construction = 'service'][zoom >= 17] { @@ -3350,6 +3488,7 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */ text-placement: line; text-halo-radius: @standard-halo-radius; [highway = 'raceway'] { text-halo-fill: @raceway-fill; } + [highway = 'busway'] { text-halo-fill: @busway-fill; } [highway = 'service'] { text-halo-fill: @service-fill; } text-face-name: @book-fonts; text-repeat-distance: @major-highway-text-repeat-distance; @@ -3479,6 +3618,7 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */ [highway = 'unclassified'], [highway = 'living_street'], [highway = 'road'], + [highway = 'busway'], [highway = 'service'], [highway = 'pedestrian'], [highway = 'raceway'] { @@ -3524,6 +3664,9 @@ tertiary is rendered from z10 and is not included in osm_planet_roads. */ [highway = 'pedestrian'] { marker-fill: @pedestrian-oneway-arrow-color; } + [highway = 'busway'] { + marker-fill: @busway-oneway-arrow-color; + } [highway = 'raceway'] { marker-fill: @raceway-oneway-arrow-color; }