diff --git a/layers/transportation/layer.sql b/layers/transportation/layer.sql index 03ff726..c29800f 100644 --- a/layers/transportation/layer.sql +++ b/layers/transportation/layer.sql @@ -6,13 +6,18 @@ $$ LANGUAGE SQL IMMUTABLE STRICT; -- etldoc: layer_transportation[shape=record fillcolor=lightpink, style="rounded,filled", -- etldoc: label=" layer_transportation | z4 | z5 | z6 | z7 | z8 | z9 | z10 | z11 | z12| z13| z14+" ] ; CREATE OR REPLACE FUNCTION layer_transportation(bbox geometry, zoom_level int) -RETURNS TABLE(osm_id bigint, geometry geometry, class text, ramp int, oneway int, brunnel TEXT, service TEXT) AS $$ +RETURNS TABLE(osm_id bigint, geometry geometry, class text, subclass text, +ramp int, oneway int, brunnel TEXT, service TEXT) AS $$ SELECT osm_id, geometry, CASE WHEN highway IS NOT NULL THEN highway_class(highway) WHEN railway IS NOT NULL THEN railway_class(railway) END AS class, + CASE + WHEN railway IS NOT NULL THEN railway + ELSE NULL + END AS subclass, -- 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, diff --git a/layers/transportation/transportation.yaml b/layers/transportation/transportation.yaml index 0733be2..0ecc174 100644 --- a/layers/transportation/transportation.yaml +++ b/layers/transportation/transportation.yaml @@ -30,6 +30,20 @@ layer: - raceway - rail - transit + subclass: + description: | + Distinguish more specific railway classes: + Subclass is value of the + [`railway`](http://wiki.openstreetmap.org/wiki/Key:railway) tag. + values: + - rail + - narrow_gauge + - preserved + - funicular + - subway + - light_rail + - monorail + - tram brunnel: description: | Mark whether way is a tunnel or bridge. @@ -61,7 +75,7 @@ layer: datasource: geometry_field: geometry srid: 900913 - query: (SELECT geometry, class, oneway, ramp, brunnel, service FROM layer_transportation(!bbox!, z(!scale_denominator!))) AS t + query: (SELECT geometry, class, subclass, oneway, ramp, brunnel, service FROM layer_transportation(!bbox!, z(!scale_denominator!))) AS t schema: - ./class.sql - ./update_transportation_merge.sql