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

@@ -21,6 +21,7 @@ CREATE OR REPLACE FUNCTION layer_transportation(bbox geometry, zoom_level int)
brunnel text,
service text,
access text,
toll int,
layer int,
level int,
indoor int,
@@ -59,6 +60,7 @@ SELECT osm_id,
brunnel(is_bridge, is_tunnel, is_ford) AS brunnel,
NULLIF(service, '') AS service,
access,
CASE WHEN toll = TRUE THEN 1 END AS toll,
NULLIF(layer, 0) AS layer,
"level",
CASE WHEN indoor = TRUE THEN 1 END AS indoor,
@@ -80,6 +82,7 @@ FROM (
NULL AS public_transport,
NULL AS service,
NULL AS access,
NULL::boolean AS toll,
is_bridge,
is_tunnel,
is_ford,
@@ -111,6 +114,7 @@ FROM (
NULL AS public_transport,
NULL AS service,
NULL AS access,
NULL::boolean AS toll,
is_bridge,
is_tunnel,
is_ford,
@@ -142,6 +146,7 @@ FROM (
NULL AS public_transport,
NULL AS service,
NULL AS access,
NULL::boolean AS toll,
is_bridge,
is_tunnel,
is_ford,
@@ -173,6 +178,7 @@ FROM (
NULL AS public_transport,
NULL AS service,
NULL AS access,
NULL::boolean AS toll,
is_bridge,
is_tunnel,
is_ford,
@@ -204,6 +210,7 @@ FROM (
NULL AS public_transport,
NULL AS service,
NULL AS access,
NULL::boolean AS toll,
is_bridge,
is_tunnel,
is_ford,
@@ -235,6 +242,7 @@ FROM (
NULL AS public_transport,
NULL AS service,
access,
toll,
is_bridge,
is_tunnel,
is_ford,
@@ -266,6 +274,7 @@ FROM (
NULL AS public_transport,
NULL AS service,
access,
toll,
is_bridge,
is_tunnel,
is_ford,
@@ -297,6 +306,7 @@ FROM (
NULL AS public_transport,
NULL AS service,
access,
toll,
is_bridge,
is_tunnel,
is_ford,
@@ -330,6 +340,7 @@ FROM (
public_transport,
service_value(service) AS service,
CASE WHEN access IN ('private', 'no') THEN 'no' END AS access,
CASE WHEN toll='yes' THEN true ELSE NULL::boolean END AS toll,
is_bridge,
is_tunnel,
is_ford,
@@ -380,6 +391,7 @@ FROM (
NULL AS public_transport,
service_value(service) AS service,
NULL::text AS access,
NULL::boolean AS toll,
NULL::boolean AS is_bridge,
NULL::boolean AS is_tunnel,
NULL::boolean AS is_ford,
@@ -414,6 +426,7 @@ FROM (
NULL AS public_transport,
service_value(service) AS service,
NULL::text AS access,
NULL::boolean AS toll,
NULL::boolean AS is_bridge,
NULL::boolean AS is_tunnel,
NULL::boolean AS is_ford,
@@ -448,6 +461,7 @@ FROM (
NULL AS public_transport,
service_value(service) AS service,
NULL::text AS access,
NULL::boolean AS toll,
is_bridge,
is_tunnel,
is_ford,
@@ -481,6 +495,7 @@ FROM (
NULL AS public_transport,
service_value(service) AS service,
NULL::text AS access,
NULL::boolean AS toll,
is_bridge,
is_tunnel,
is_ford,
@@ -514,6 +529,7 @@ FROM (
NULL AS public_transport,
service_value(service) AS service,
NULL::text AS access,
NULL::boolean AS toll,
is_bridge,
is_tunnel,
is_ford,
@@ -548,6 +564,7 @@ FROM (
NULL AS public_transport,
service_value(service) AS service,
NULL::text AS access,
NULL::boolean AS toll,
is_bridge,
is_tunnel,
is_ford,
@@ -582,6 +599,7 @@ FROM (
NULL AS public_transport,
service_value(service) AS service,
NULL::text AS access,
NULL::boolean AS toll,
is_bridge,
is_tunnel,
is_ford,
@@ -614,6 +632,7 @@ FROM (
NULL AS public_transport,
service_value(service) AS service,
NULL::text AS access,
NULL::boolean AS toll,
is_bridge,
is_tunnel,
is_ford,
@@ -645,6 +664,7 @@ FROM (
NULL AS public_transport,
service_value(service) AS service,
NULL::text AS access,
NULL::boolean AS toll,
is_bridge,
is_tunnel,
is_ford,
@@ -676,6 +696,7 @@ FROM (
NULL AS public_transport,
service_value(service) AS service,
NULL::text AS access,
NULL::boolean AS toll,
is_bridge,
is_tunnel,
is_ford,
@@ -708,6 +729,7 @@ FROM (
NULL AS public_transport,
service_value(service) AS service,
NULL::text AS access,
NULL::boolean AS toll,
is_bridge,
is_tunnel,
is_ford,
@@ -744,6 +766,7 @@ FROM (
public_transport,
NULL AS service,
NULL::text AS access,
NULL::boolean AS toll,
CASE
WHEN man_made IN ('bridge') THEN TRUE
ELSE FALSE