Add toll tagging (#1177)

Fixes #366

This PR sets `toll=1` in the `transportation` layer when a road is tagged as a toll road in OSM (with the tag `toll=yes`).  If a road is tagged with any other value of `tag=*`, the value is suppressed in the tile, since non-toll roads can be presumed as the default and therefore this PR should have only negligible impact in the tiles.

Support for toll road tagging is of interest in the American mapping community, because toll roads have historically been styled differently on American-style maps, for example:
![image](https://user-images.githubusercontent.com/3254090/129505967-5916eace-596a-4c89-ac5d-0aab3e641ed7.png)


Screen shot of a toll road being generated in the `transportation` layer tiles:
![image](https://user-images.githubusercontent.com/3254090/129505683-eb315643-95ff-455b-a606-f379f776f92d.png)
This commit is contained in:
Brian Sperlongano
2021-08-19 01:12:10 -04:00
committed by GitHub
parent e37076c133
commit 7ca751ec7a
4 changed files with 41 additions and 5 deletions

View File

@@ -30,13 +30,15 @@ SELECT (ST_Dump(ST_LineMerge(ST_Collect(geometry)))).geom AS geometry,
horse,
mtb_scale,
CASE
WHEN access IN ('private', 'no')
THEN 'no'
ELSE NULL::text END AS access,
WHEN access IN ('private', 'no') THEN 'no'
ELSE NULL::text END AS access,
CASE
WHEN toll = 'yes' THEN true
ELSE false END AS toll,
layer
FROM osm_highway_linestring_gen_z11
-- mapping.yaml pre-filter: motorway/trunk/primary/secondary/tertiary, with _link variants, construction, ST_IsValid()
GROUP BY highway, network, construction, is_bridge, is_tunnel, is_ford, bicycle, foot, horse, mtb_scale, access, layer
GROUP BY highway, network, construction, is_bridge, is_tunnel, is_ford, bicycle, foot, horse, mtb_scale, access, toll, layer
) /* DELAY_MATERIALIZED_VIEW_CREATION */;
CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen_z11_geometry_idx
ON osm_transportation_merge_linestring_gen_z11 USING gist (geometry);
@@ -58,6 +60,7 @@ SELECT ST_Simplify(geometry, ZRes(12)) AS geometry,
horse,
mtb_scale,
access,
toll,
layer
FROM osm_transportation_merge_linestring_gen_z11
WHERE highway NOT IN ('tertiary', 'tertiary_link')
@@ -83,6 +86,7 @@ SELECT ST_Simplify(geometry, ZRes(11)) AS geometry,
horse,
mtb_scale,
access,
toll,
layer
FROM osm_transportation_merge_linestring_gen_z10
-- Current view: motorway/primary/secondary, with _link variants and construction