From cded42349fe97dc81d1e680a78bab7e768cb5088 Mon Sep 17 00:00:00 2001 From: Brian Sperlongano Date: Thu, 28 Oct 2021 09:08:56 -0400 Subject: [PATCH] Remove unnecessary ramp tagging (#1266) This PR removes unnecessary `ramp` tagging from the `transportation` layer. The `ramp` tag is used for two situations. First, it is set for all `highway=***_link` tags to indicate a highway ramp. The second situation is when the `ramp` tag is set on a highway object, which indicates the presence of a ramp, such as one that would be used for a wheelchair. `ramp=0` is a reasonable default in these situations; by removing cases of `ramp=0` and presenting only `ramp=1` to the tiles, we can save considerable size in the tiles. Additionally, there appears to be a bug in which all objects tagged `highway=steps` are inexplicably tagged `ramp=1`. The changes as follows: 1. Remove `ramp=0` where it appears in the tile. 2. `highway=steps` no longer assumes `ramp=1` in cases where `ramp=*` is not explicitly set. In the current behavior, `ramp=0` is tagged only in at z13+ but suppressed in lower zooms: ![image](https://user-images.githubusercontent.com/3254090/137589213-5a3432df-8c19-47bf-b556-7be15479790c.png) ![image](https://user-images.githubusercontent.com/3254090/137589296-f3126264-fb07-4346-ba70-c1f1b007a709.png) ![image](https://user-images.githubusercontent.com/3254090/137589306-30f9821b-3160-4b45-98b3-f2b8a0ae3a13.png) This PR unifies `ramp=0` suppression between z13+ and z12-. --- layers/transportation/transportation.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/layers/transportation/transportation.sql b/layers/transportation/transportation.sql index 1b2f2d86..8c48fc60 100644 --- a/layers/transportation/transportation.sql +++ b/layers/transportation/transportation.sql @@ -53,9 +53,9 @@ SELECT osm_id, NULLIF(network, '') AS network, -- All links are considered as ramps as well CASE - WHEN highway_is_link(highway) OR highway = 'steps' - THEN 1 - ELSE is_ramp::int END AS ramp, + WHEN highway_is_link(highway) + OR is_ramp + THEN 1 END AS ramp, is_oneway::int AS oneway, brunnel(is_bridge, is_tunnel, is_ford) AS brunnel, NULLIF(service, '') AS service,