Skip to content

Commit

Permalink
Render highway=busway, alter highway=bus_guideway
Browse files Browse the repository at this point in the history
Fixes #4226. Introduces rendering for `highway=busway`, an approved tag
with over 11,000 uses. This fixes gaps being left on the map where
bus-only roads are present and mapped.

Fixes #3396, #3581, and #4567. Makes `highway=bus_guideway` match rendering of
`highway=busway` due to an increasingly small distinction between the
two in reality. Moves `highway=bus_guideway` to road layer.

Includes rendering for unpaved busway and bus_guideway.
  • Loading branch information
jdhoek committed Sep 1, 2023
1 parent 445e553 commit 0156bfe
Show file tree
Hide file tree
Showing 5 changed files with 305 additions and 39 deletions.
2 changes: 2 additions & 0 deletions openstreetmap-carto.lua
Expand Up @@ -203,6 +203,8 @@ local roads_info = {
primary_link = {z = 220, roads = true},
secondary_link = {z = 210, roads = true},
tertiary_link = {z = 200, roads = false},
busway = {z = 180, roads = false},
bus_guideway = {z = 180, roads = false},
service = {z = 150, roads = false},
track = {z = 110, roads = false},
path = {z = 100, roads = false},
Expand Down
29 changes: 11 additions & 18 deletions project.mml
Expand Up @@ -629,8 +629,10 @@ Layer:
('unclassified', 4),
('residential', 5),
('living_street', 6),
('service', 7),
('track', 8)
('busway', 7),
('bus_guideway', 8),
('service', 9),
('track', 10)
) AS v (highway, prio)
ON v.highway = l.highway
WHERE p.highway IN (
Expand Down Expand Up @@ -707,6 +709,8 @@ Layer:
END AS int_surface,
CASE WHEN access IN ('destination') THEN 'destination'::text
WHEN access IN ('no', 'private') THEN 'no'::text
-- highway=busway and highway=bus_guideway are access=no/bus=designated by default.
WHEN highway IN ('busway', 'bus_guideway') AND access IS NULL THEN 'no'::text
END AS access,
construction,
CASE
Expand Down Expand Up @@ -992,19 +996,6 @@ Layer:
cache-features: true
group-by: layernotnull
minzoom: 10
- id: guideways
geometry: linestring
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
way
FROM planet_osm_line
WHERE highway = 'bus_guideway'
) AS guideways
properties:
minzoom: 11
- id: roller-coaster-gap-fill
geometry: linestring
<<: *extents
Expand Down Expand Up @@ -1929,7 +1920,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', 'bus_guideway', 'pedestrian', 'raceway', 'living_street', 'construction')
AND (name IS NOT NULL
OR oneway IN ('yes', '-1')
OR junction IN ('roundabout'))
Expand Down Expand Up @@ -2024,17 +2015,19 @@ 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', 'bus_guideway') 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', 'bus_guideway')
AND ref IS NOT NULL
) AS p) AS q
WHERE height <= 4 AND width <= 11
ORDER BY
CASE
WHEN highway = 'unclassified' THEN 33
WHEN highway = 'residential' THEN 32
WHEN highway = 'busway' THEN 31
WHEN highway = 'bus_guideway' THEN 31
WHEN highway = 'track' THEN 30
END DESC NULLS LAST,
height DESC,
Expand Down
3 changes: 2 additions & 1 deletion scripts/generate_unpaved_patterns.py
Expand Up @@ -100,7 +100,8 @@ def main():
'pedestrian-fill',
'living-street-fill',
'raceway-fill',
'residential-fill'
'residential-fill',
'busway-fill'
}

# List of names of mss files in which we search for color variables
Expand Down

0 comments on commit 0156bfe

Please sign in to comment.