Skip to content

Commit

Permalink
Add support for Bus Rapid Transit (highway=busway) (openmaptiles#1271)
Browse files Browse the repository at this point in the history
This PR adds support for bus rapid transit (BRT) systems, mapped with the [approved tag](https://wiki.openstreetmap.org/wiki/Proposed_features/Tag:highway%3Dbusway) `highway=busway`. BRT systems commonly appear in maps that also show light rail.  Below are two examples of BRT in such maps.

![image (1)](https://user-images.githubusercontent.com/3254090/138018375-ac1f60c3-8059-4f95-bf1d-a659ca0c0103.png)
![image](https://user-images.githubusercontent.com/3254090/138018376-f809aeb3-17ba-495e-b33c-9fe54a0fa840.png)

Since BRT is equivalent in nature to light rail systems, this PR matches the zoom level of light rail, which is rendered at zoom 11+.  BRT systems are relatively uncommon, so adding this support should have negligible impact on tile size.

Below is a data rendering of [a BRT system](https://www.openstreetmap.org/relation/4051383#map=12/40.4068/-79.8646) in Pittsburgh, Pennsylvania.

![image](https://user-images.githubusercontent.com/3254090/138021552-ce974f2f-cfbd-42a0-9848-42ed44da453e.png)
  • Loading branch information
ZeLonewolf authored Nov 1, 2021
1 parent 6caab9f commit c7e7fae
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion layers/transportation/class.sql
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ SELECT CASE
(
'motorway', 'trunk', 'primary', 'secondary', 'tertiary', 'raceway',
'motorway_construction', 'trunk_construction', 'primary_construction',
'secondary_construction', 'tertiary_construction', 'raceway_construction'
'secondary_construction', 'tertiary_construction', 'raceway_construction',
'busway'
) THEN TRUE --includes ramps
ELSE FALSE
END
Expand Down
3 changes: 2 additions & 1 deletion layers/transportation/mapping.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ generalized_tables:
# etldoc: osm_highway_linestring -> osm_highway_linestring_gen_z11
highway_linestring_gen_z11:
source: highway_linestring
sql_filter: (highway IN ('motorway', 'trunk', 'primary', 'secondary', 'tertiary', 'motorway_link', 'trunk_link', 'primary_link', 'secondary_link', 'tertiary_link') OR highway = 'construction' AND construction IN ('motorway', 'trunk', 'primary', 'secondary', 'tertiary', 'motorway_link', 'trunk_link', 'primary_link', 'secondary_link', 'tertiary_link')) AND NOT is_area AND ST_IsValid(geometry)
sql_filter: (highway IN ('motorway', 'trunk', 'primary', 'secondary', 'tertiary', 'motorway_link', 'trunk_link', 'primary_link', 'secondary_link', 'tertiary_link', 'busway') OR highway = 'construction' AND construction IN ('motorway', 'trunk', 'primary', 'secondary', 'tertiary', 'motorway_link', 'trunk_link', 'primary_link', 'secondary_link', 'tertiary_link', 'busway')) AND NOT is_area AND ST_IsValid(geometry)
tolerance: ZRES12

name_field: &name
Expand Down Expand Up @@ -227,6 +227,7 @@ tables:
- service
- track
- raceway
- busway
- construction
public_transport:
- platform
Expand Down
Binary file modified layers/transportation/mapping_diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions layers/transportation/transportation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ layer:
highway: track
raceway:
highway: raceway
busway:
highway: busway
motorway_construction:
__AND__:
highway: construction
Expand Down
4 changes: 2 additions & 2 deletions layers/transportation/update_transportation_merge.sql
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ SELECT ST_Simplify(geometry, ZRes(12)) AS geometry,
toll,
layer
FROM osm_transportation_merge_linestring_gen_z11
WHERE highway NOT IN ('tertiary', 'tertiary_link')
AND construction NOT IN ('tertiary', 'tertiary_link')
WHERE highway NOT IN ('tertiary', 'tertiary_link', 'busway')
AND construction NOT IN ('tertiary', 'tertiary_link', 'busway')
) /* DELAY_MATERIALIZED_VIEW_CREATION */;
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen_z10_geometry_idx
ON osm_transportation_merge_linestring_gen_z10 USING gist (geometry);
Expand Down
Binary file modified layers/transportation_name/mapping_diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c7e7fae

Please sign in to comment.