Skip to content

Commit

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

Fixes gravitystorm#3396, gravitystorm#3581, and gravitystorm#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.
  • Loading branch information
jdhoek committed Jun 19, 2022
1 parent 17113f7 commit b4617fe
Show file tree
Hide file tree
Showing 5 changed files with 203 additions and 38 deletions.
Binary file added .project.mml.swp
Binary file not shown.
1 change: 1 addition & 0 deletions openstreetmap-carto.lua
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ 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},
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
Original file line number Diff line number Diff line change
Expand Up @@ -648,8 +648,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 @@ -725,6 +727,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 @@ -999,19 +1003,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: entrances
geometry: point
<<: *extents
Expand Down Expand Up @@ -1863,7 +1854,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 @@ -1958,17 +1949,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
Binary file added style/.roads.mss.swp
Binary file not shown.
Loading

0 comments on commit b4617fe

Please sign in to comment.