Merge pull request #604 from zstadler/bicycle-foot-horse-mtb_scale

Add bicycle, foot, horse, and mtb_scale to the transportation layer
pull/663/head
Eva Jelinkova 2019-10-31 19:20:19 +01:00 zatwierdzone przez GitHub
commit d7afc6cb76
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 64 dodań i 9 usunięć

Wyświetl plik

@ -8,7 +8,7 @@ $$ LANGUAGE SQL IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION layer_transportation(bbox geometry, zoom_level int) CREATE OR REPLACE FUNCTION layer_transportation(bbox geometry, zoom_level int)
RETURNS TABLE(osm_id bigint, geometry geometry, class text, subclass text, RETURNS TABLE(osm_id bigint, geometry geometry, class text, subclass text,
ramp int, oneway int, brunnel TEXT, service TEXT, layer INT, level INT, ramp int, oneway int, brunnel TEXT, service TEXT, layer INT, level INT,
indoor INT, surface TEXT) AS $$ indoor INT, bicycle TEXT, foot TEXT, horse TEXT, mtb_scale TEXT, surface TEXT) AS $$
SELECT SELECT
osm_id, geometry, osm_id, geometry,
CASE CASE
@ -34,6 +34,10 @@ indoor INT, surface TEXT) AS $$
NULLIF(layer, 0) AS layer, NULLIF(layer, 0) AS layer,
"level", "level",
CASE WHEN indoor=TRUE THEN 1 ELSE NULL END as indoor, CASE WHEN indoor=TRUE THEN 1 ELSE NULL END as indoor,
NULLIF(bicycle, '') AS bicycle,
NULLIF(foot, '') AS foot,
NULLIF(horse, '') AS horse,
NULLIF(mtb_scale, '') AS mtb_scale,
NULLIF(surface, '') AS surface NULLIF(surface, '') AS surface
FROM ( FROM (
-- etldoc: osm_transportation_merge_linestring_gen7 -> layer_transportation:z4 -- etldoc: osm_transportation_merge_linestring_gen7 -> layer_transportation:z4
@ -45,8 +49,8 @@ indoor INT, surface TEXT) AS $$
NULL::boolean AS is_ford, NULL::boolean AS is_ford,
NULL::boolean AS is_ramp, NULL::int AS is_oneway, NULL as man_made, NULL::boolean AS is_ramp, NULL::int AS is_oneway, NULL as man_made,
NULL::int AS layer, NULL::int AS level, NULL::boolean AS indoor, NULL::int AS layer, NULL::int AS level, NULL::boolean AS indoor,
NULL AS surface, NULL as bicycle, NULL as foot, NULL as horse, NULL as mtb_scale,
z_order NULL AS surface, z_order
FROM osm_transportation_merge_linestring_gen7 FROM osm_transportation_merge_linestring_gen7
WHERE zoom_level = 4 WHERE zoom_level = 4
UNION ALL UNION ALL
@ -60,6 +64,7 @@ indoor INT, surface TEXT) AS $$
NULL::boolean AS is_ford, NULL::boolean AS is_ford,
NULL::boolean AS is_ramp, NULL::int AS is_oneway, NULL as man_made, NULL::boolean AS is_ramp, NULL::int AS is_oneway, NULL as man_made,
NULL::int AS layer, NULL::int AS level, NULL::boolean AS indoor, NULL::int AS layer, NULL::int AS level, NULL::boolean AS indoor,
NULL as bicycle, NULL as foot, NULL as horse, NULL as mtb_scale,
NULL AS surface, z_order NULL AS surface, z_order
FROM osm_transportation_merge_linestring_gen6 FROM osm_transportation_merge_linestring_gen6
WHERE zoom_level = 5 WHERE zoom_level = 5
@ -74,6 +79,7 @@ indoor INT, surface TEXT) AS $$
NULL::boolean AS is_ford, NULL::boolean AS is_ford,
NULL::boolean AS is_ramp, NULL::int AS is_oneway, NULL as man_made, NULL::boolean AS is_ramp, NULL::int AS is_oneway, NULL as man_made,
NULL::int AS layer, NULL::int AS level, NULL::boolean AS indoor, NULL::int AS layer, NULL::int AS level, NULL::boolean AS indoor,
NULL as bicycle, NULL as foot, NULL as horse, NULL as mtb_scale,
NULL AS surface, z_order NULL AS surface, z_order
FROM osm_transportation_merge_linestring_gen5 FROM osm_transportation_merge_linestring_gen5
WHERE zoom_level = 6 WHERE zoom_level = 6
@ -88,6 +94,7 @@ indoor INT, surface TEXT) AS $$
NULL::boolean AS is_ford, NULL::boolean AS is_ford,
NULL::boolean AS is_ramp, NULL::int AS is_oneway, NULL as man_made, NULL::boolean AS is_ramp, NULL::int AS is_oneway, NULL as man_made,
NULL::int AS layer, NULL::int AS level, NULL::boolean AS indoor, NULL::int AS layer, NULL::int AS level, NULL::boolean AS indoor,
NULL as bicycle, NULL as foot, NULL as horse, NULL as mtb_scale,
NULL AS surface, z_order NULL AS surface, z_order
FROM osm_transportation_merge_linestring_gen4 FROM osm_transportation_merge_linestring_gen4
WHERE zoom_level = 7 WHERE zoom_level = 7
@ -102,6 +109,7 @@ indoor INT, surface TEXT) AS $$
NULL::boolean AS is_ford, NULL::boolean AS is_ford,
NULL::boolean AS is_ramp, NULL::int AS is_oneway, NULL as man_made, NULL::boolean AS is_ramp, NULL::int AS is_oneway, NULL as man_made,
NULL::int AS layer, NULL::int AS level, NULL::boolean AS indoor, NULL::int AS layer, NULL::int AS level, NULL::boolean AS indoor,
NULL as bicycle, NULL as foot, NULL as horse, NULL as mtb_scale,
NULL AS surface, z_order NULL AS surface, z_order
FROM osm_transportation_merge_linestring_gen3 FROM osm_transportation_merge_linestring_gen3
WHERE zoom_level = 8 WHERE zoom_level = 8
@ -117,6 +125,7 @@ indoor INT, surface TEXT) AS $$
NULL::boolean AS is_ford, NULL::boolean AS is_ford,
NULL::boolean AS is_ramp, NULL::int AS is_oneway, NULL as man_made, NULL::boolean AS is_ramp, NULL::int AS is_oneway, NULL as man_made,
layer, NULL::int AS level, NULL::boolean AS indoor, layer, NULL::int AS level, NULL::boolean AS indoor,
bicycle, foot, horse, mtb_scale,
NULL AS surface, z_order NULL AS surface, z_order
FROM osm_highway_linestring_gen2 FROM osm_highway_linestring_gen2
WHERE zoom_level BETWEEN 9 AND 10 WHERE zoom_level BETWEEN 9 AND 10
@ -132,6 +141,7 @@ indoor INT, surface TEXT) AS $$
NULL::boolean AS is_ford, NULL::boolean AS is_ford,
NULL::boolean AS is_ramp, NULL::int AS is_oneway, NULL as man_made, NULL::boolean AS is_ramp, NULL::int AS is_oneway, NULL as man_made,
layer, NULL::int AS level, NULL::boolean AS indoor, layer, NULL::int AS level, NULL::boolean AS indoor,
bicycle, foot, horse, mtb_scale,
NULL AS surface, z_order NULL AS surface, z_order
FROM osm_highway_linestring_gen1 FROM osm_highway_linestring_gen1
WHERE zoom_level = 11 WHERE zoom_level = 11
@ -153,6 +163,7 @@ indoor INT, surface TEXT) AS $$
CASE WHEN highway IN ('footway', 'steps') THEN indoor CASE WHEN highway IN ('footway', 'steps') THEN indoor
ELSE NULL::boolean ELSE NULL::boolean
END AS indoor, END AS indoor,
bicycle, foot, horse, mtb_scale,
surface_value(surface) AS "surface", surface_value(surface) AS "surface",
z_order z_order
FROM osm_highway_linestring FROM osm_highway_linestring
@ -185,6 +196,7 @@ indoor INT, surface TEXT) AS $$
NULL::boolean AS is_ford, NULL::boolean AS is_ford,
NULL::boolean AS is_ramp, NULL::int AS is_oneway, NULL as man_made, NULL::boolean AS is_ramp, NULL::int AS is_oneway, NULL as man_made,
NULL::int AS layer, NULL::int AS level, NULL::boolean AS indoor, NULL::int AS layer, NULL::int AS level, NULL::boolean AS indoor,
NULL as bicycle, NULL as foot, NULL as horse, NULL as mtb_scale,
NULL as surface, z_order NULL as surface, z_order
FROM osm_railway_linestring_gen5 FROM osm_railway_linestring_gen5
WHERE zoom_level = 8 WHERE zoom_level = 8
@ -200,6 +212,7 @@ indoor INT, surface TEXT) AS $$
NULL::boolean AS is_ford, NULL::boolean AS is_ford,
NULL::boolean AS is_ramp, NULL::int AS is_oneway, NULL as man_made, NULL::boolean AS is_ramp, NULL::int AS is_oneway, NULL as man_made,
layer, NULL::int AS level, NULL::boolean AS indoor, layer, NULL::int AS level, NULL::boolean AS indoor,
NULL as bicycle, NULL as foot, NULL as horse, NULL as mtb_scale,
NULL AS surface, z_order NULL AS surface, z_order
FROM osm_railway_linestring_gen4 FROM osm_railway_linestring_gen4
WHERE zoom_level = 9 WHERE zoom_level = 9
@ -213,6 +226,7 @@ indoor INT, surface TEXT) AS $$
NULL AS public_transport, service_value(service) AS service, NULL AS public_transport, service_value(service) AS service,
is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made, is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made,
layer, NULL::int AS level, NULL::boolean AS indoor, layer, NULL::int AS level, NULL::boolean AS indoor,
NULL as bicycle, NULL as foot, NULL as horse, NULL as mtb_scale,
NULL AS surface, z_order NULL AS surface, z_order
FROM osm_railway_linestring_gen3 FROM osm_railway_linestring_gen3
WHERE zoom_level = 10 WHERE zoom_level = 10
@ -226,6 +240,7 @@ indoor INT, surface TEXT) AS $$
NULL AS public_transport, service_value(service) AS service, NULL AS public_transport, service_value(service) AS service,
is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made, is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made,
layer, NULL::int AS level, NULL::boolean AS indoor, layer, NULL::int AS level, NULL::boolean AS indoor,
NULL as bicycle, NULL as foot, NULL as horse, NULL as mtb_scale,
NULL as surface, z_order NULL as surface, z_order
FROM osm_railway_linestring_gen2 FROM osm_railway_linestring_gen2
WHERE zoom_level = 11 WHERE zoom_level = 11
@ -239,6 +254,7 @@ indoor INT, surface TEXT) AS $$
NULL AS public_transport, service_value(service) AS service, NULL AS public_transport, service_value(service) AS service,
is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made, is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made,
layer, NULL::int AS level, NULL::boolean AS indoor, layer, NULL::int AS level, NULL::boolean AS indoor,
NULL as bicycle, NULL as foot, NULL as horse, NULL as mtb_scale,
NULL as surface, z_order NULL as surface, z_order
FROM osm_railway_linestring_gen1 FROM osm_railway_linestring_gen1
WHERE zoom_level = 12 WHERE zoom_level = 12
@ -253,6 +269,7 @@ indoor INT, surface TEXT) AS $$
NULL AS public_transport, service_value(service) AS service, NULL AS public_transport, service_value(service) AS service,
is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made, is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made,
layer, NULL::int AS level, NULL::boolean AS indoor, layer, NULL::int AS level, NULL::boolean AS indoor,
NULL as bicycle, NULL as foot, NULL as horse, NULL as mtb_scale,
NULL as surface, z_order NULL as surface, z_order
FROM osm_railway_linestring FROM osm_railway_linestring
WHERE zoom_level = 13 WHERE zoom_level = 13
@ -267,6 +284,7 @@ indoor INT, surface TEXT) AS $$
NULL AS public_transport, service_value(service) AS service, NULL AS public_transport, service_value(service) AS service,
is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made, is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made,
layer, NULL::int AS level, NULL::boolean AS indoor, layer, NULL::int AS level, NULL::boolean AS indoor,
NULL as bicycle, NULL as foot, NULL as horse, NULL as mtb_scale,
NULL AS surface, z_order NULL AS surface, z_order
FROM osm_aerialway_linestring_gen1 FROM osm_aerialway_linestring_gen1
WHERE zoom_level = 12 WHERE zoom_level = 12
@ -280,6 +298,7 @@ indoor INT, surface TEXT) AS $$
NULL AS public_transport, service_value(service) AS service, NULL AS public_transport, service_value(service) AS service,
is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made, is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made,
layer, NULL::int AS level, NULL::boolean AS indoor, layer, NULL::int AS level, NULL::boolean AS indoor,
NULL as bicycle, NULL as foot, NULL as horse, NULL as mtb_scale,
NULL AS surface, z_order NULL AS surface, z_order
FROM osm_aerialway_linestring FROM osm_aerialway_linestring
WHERE zoom_level >= 13 WHERE zoom_level >= 13
@ -292,6 +311,7 @@ indoor INT, surface TEXT) AS $$
NULL AS public_transport, service_value(service) AS service, NULL AS public_transport, service_value(service) AS service,
is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made, is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made,
layer, NULL::int AS level, NULL::boolean AS indoor, layer, NULL::int AS level, NULL::boolean AS indoor,
NULL as bicycle, NULL as foot, NULL as horse, NULL as mtb_scale,
NULL AS surface, z_order NULL AS surface, z_order
FROM osm_shipway_linestring_gen2 FROM osm_shipway_linestring_gen2
WHERE zoom_level = 11 WHERE zoom_level = 11
@ -304,6 +324,7 @@ indoor INT, surface TEXT) AS $$
NULL AS public_transport, service_value(service) AS service, NULL AS public_transport, service_value(service) AS service,
is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made, is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made,
layer, NULL::int AS level, NULL::boolean AS indoor, layer, NULL::int AS level, NULL::boolean AS indoor,
NULL as bicycle, NULL as foot, NULL as horse, NULL as mtb_scale,
NULL AS surface, z_order NULL AS surface, z_order
FROM osm_shipway_linestring_gen1 FROM osm_shipway_linestring_gen1
WHERE zoom_level = 12 WHERE zoom_level = 12
@ -317,6 +338,7 @@ indoor INT, surface TEXT) AS $$
NULL AS public_transport, service_value(service) AS service, NULL AS public_transport, service_value(service) AS service,
is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made, is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made,
layer, NULL::int AS level, NULL::boolean AS indoor, layer, NULL::int AS level, NULL::boolean AS indoor,
NULL as bicycle, NULL as foot, NULL as horse, NULL as mtb_scale,
NULL AS surface, z_order NULL AS surface, z_order
FROM osm_shipway_linestring FROM osm_shipway_linestring
WHERE zoom_level >= 13 WHERE zoom_level >= 13
@ -337,6 +359,7 @@ indoor INT, surface TEXT) AS $$
END AS is_bridge, FALSE AS is_tunnel, FALSE AS is_ford, END AS is_bridge, FALSE AS is_tunnel, FALSE AS is_ford,
FALSE AS is_ramp, FALSE::int AS is_oneway, man_made, FALSE AS is_ramp, FALSE::int AS is_oneway, man_made,
layer, NULL::int AS level, NULL::boolean AS indoor, layer, NULL::int AS level, NULL::boolean AS indoor,
NULL as bicycle, NULL as foot, NULL as horse, NULL as mtb_scale,
NULL AS surface, z_order NULL AS surface, z_order
FROM osm_highway_polygon FROM osm_highway_polygon
-- We do not want underground pedestrian areas for now -- We do not want underground pedestrian areas for now

Wyświetl plik

@ -133,6 +133,22 @@ man_made_field: &man_made
z_order_field: &z_order z_order_field: &z_order
name: z_order name: z_order
type: wayzorder type: wayzorder
bicycle_field: &bicycle
key: bicycle
name: bicycle
type: string
foot_field: &foot
key: foot
name: foot
type: string
horse_field: &horse
key: horse
name: horse
type: string
mtb_scale_field: &mtb_scale
key: mtb:scale
name: mtb_scale
type: string
surface_field: &surface surface_field: &surface
key: surface key: surface
name: surface name: surface
@ -175,6 +191,10 @@ tables:
- *usage - *usage
- *public_transport - *public_transport
- *man_made - *man_made
- *bicycle
- *foot
- *horse
- *mtb_scale
- *surface - *surface
mapping: mapping:
highway: highway:

Wyświetl plik

@ -106,17 +106,29 @@ layer:
- parking_aisle - parking_aisle
layer: layer:
description: | description: |
Original value of [`layer`](http://wiki.openstreetmap.org/wiki/Key:layer) tag. Original value of the [`layer`](http://wiki.openstreetmap.org/wiki/Key:layer) tag.
level: level:
description: | description: |
Experimental feature! Filled only for steps and footways. Original Experimental feature! Filled only for steps and footways. Original
value of [`level`](http://wiki.openstreetmap.org/wiki/Key:level) tag. value of the [`level`](http://wiki.openstreetmap.org/wiki/Key:level) tag.
indoor: indoor:
description: | description: |
Experimental feature! Filled only for steps and footways. Original Experimental feature! Filled only for steps and footways. Original
value of [`indoor`](http://wiki.openstreetmap.org/wiki/Key:indoor) tag. value of the [`indoor`](http://wiki.openstreetmap.org/wiki/Key:indoor) tag.
values: values:
- 1 - 1
bicycle:
description: |
Original value of the [`bicycle`](http://wiki.openstreetmap.org/wiki/Key:bicycle) tag (highways only).
foot:
description: |
Original value of the [`foot`](http://wiki.openstreetmap.org/wiki/Key:foot) tag (highways only).
hourse:
description: |
Original value of the [`hourse`](http://wiki.openstreetmap.org/wiki/Key:hourse) tag (highways only).
mtb_scale:
description: |
Original value of the [`mtb:scale`](http://wiki.openstreetmap.org/wiki/Key:mtb:scale) tag (highways only).
surface: surface:
description: | description: |
Values of [`surface`](https://wiki.openstreetmap.org/wiki/Key:surface) tag devided into 2 groups `paved` (paved, asphalt, cobblestone, concrete, concrete:lanes, concrete:plates, metal, paving_stones, sett, unhewn_cobblestone, wood) and `unpaved` (unpaved, compacted, dirt, earth, fine_gravel, grass, grass_paver, gravel, gravel_turf, ground, ice, mud, pebblestone, salt, sand, snow, woodchips). Values of [`surface`](https://wiki.openstreetmap.org/wiki/Key:surface) tag devided into 2 groups `paved` (paved, asphalt, cobblestone, concrete, concrete:lanes, concrete:plates, metal, paving_stones, sett, unhewn_cobblestone, wood) and `unpaved` (unpaved, compacted, dirt, earth, fine_gravel, grass, grass_paver, gravel, gravel_turf, ground, ice, mud, pebblestone, salt, sand, snow, woodchips).
@ -126,7 +138,7 @@ layer:
datasource: datasource:
geometry_field: geometry geometry_field: geometry
srid: 900913 srid: 900913
query: (SELECT geometry, class, subclass, oneway, ramp, brunnel, service, layer, level, indoor, surface FROM layer_transportation(!bbox!, z(!scale_denominator!))) AS t query: (SELECT geometry, class, subclass, oneway, ramp, brunnel, service, layer, level, indoor, bicycle, foot, horse, mtb_scale, surface FROM layer_transportation(!bbox!, z(!scale_denominator!))) AS t
schema: schema:
- ./class.sql - ./class.sql
- ./update_transportation_merge.sql - ./update_transportation_merge.sql