Merge branch 'master' into patch-3

pull/624/head
Dalibor Janák 2019-05-20 13:17:43 +02:00 zatwierdzone przez GitHub
commit 0ecfe3bd63
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
13 zmienionych plików z 88 dodań i 48 usunięć

Wyświetl plik

@ -26,33 +26,35 @@ layer:
or [`wetland`](http://wiki.openstreetmap.org/wiki/Key:wetland) tag.
values:
- allotments
- bare_rock
- beach
- bog
- farm
- farmland
- orchard
- plant_nursery
- vineyard
- forest
- garden
- glacier
- grass
- grassland
- glacier
- meadow
- forest
- village_green
- recreation_ground
- park
- garden
- wetland
- grassland
- bog
- swamp
- wet_meadow
- mangrove
- marsh
- meadow
- orchard
- park
- plant_nursery
- recreation_ground
- reedbed
- saltern
- tidalflat
- saltmarsh
- mangrove
- beach
- sand
- scree
- swamp
- tidalflat
- village_green
- vineyard
- wet_meadow
- wetland
- wood
datasource:
geometry_field: geometry
query: (SELECT geometry, class, subclass FROM layer_landcover(!bbox!, z(!scale_denominator!))) AS t

Wyświetl plik

@ -32,6 +32,7 @@ layer:
- stadium
- pitch
- playground
- track
- theme_park
- zoo
- suburb

Wyświetl plik

@ -75,6 +75,7 @@ tables:
- stadium
- pitch
- playground
- track
tourism:
- theme_park
- zoo

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 37 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 52 KiB

Wyświetl plik

@ -44,7 +44,7 @@ RETURNS TEXT AS $$
WHEN subclass IN ('supermarket','deli','delicatessen','department_store','greengrocer','marketplace') THEN 'grocery'
WHEN subclass IN ('books','library') THEN 'library'
WHEN subclass IN ('university','college') THEN 'college'
WHEN subclass IN ('hotel','motel','bed_and_breakfast','guest_house','hostel','chalet','alpine_hut') THEN 'lodging'
WHEN subclass IN ('hotel','motel','bed_and_breakfast','guest_house','hostel','chalet','alpine_hut','dormitory') THEN 'lodging'
WHEN subclass IN ('chocolate','confectionery') THEN 'ice_cream'
WHEN subclass IN ('post_box','post_office') THEN 'post'
WHEN subclass IN ('cafe') THEN 'cafe'

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 28 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 29 KiB

Wyświetl plik

@ -73,6 +73,10 @@ def_poi_mapping_barrier: &poi_mapping_barrier
- stile
- toll_booth
# building values , see http://taginfo.openstreetmap.org/keys/building#values
def_poi_mapping_building: &poi_mapping_building
- dormitory
# highway values , see http://taginfo.openstreetmap.org/keys/highway#values
def_poi_mapping_highway: &poi_mapping_highway
- bus_stop
@ -364,6 +368,7 @@ tables:
aerialway: *poi_mapping_aerialway
amenity: *poi_mapping_amenity
barrier: *poi_mapping_barrier
building: *poi_mapping_building
highway: *poi_mapping_highway
historic: *poi_mapping_historic
landuse: *poi_mapping_landuse
@ -429,6 +434,7 @@ tables:
aerialway: *poi_mapping_aerialway
amenity: *poi_mapping_amenity
barrier: *poi_mapping_barrier
building: *poi_mapping_building
highway: *poi_mapping_highway
historic: *poi_mapping_historic
landuse: *poi_mapping_landuse

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 1.2 MiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 1.2 MiB

Wyświetl plik

@ -18,15 +18,21 @@ layer:
description: |
Original value of either the
[`amenity`](http://wiki.openstreetmap.org/wiki/Key:amenity),
[`leisure`](http://wiki.openstreetmap.org/wiki/Key:leisure),
[`landuse`](http://wiki.openstreetmap.org/wiki/Key:landuse),
[`railway`](http://wiki.openstreetmap.org/wiki/Key:railway),
[`station`](http://wiki.openstreetmap.org/wiki/Key:station),
[`sport`](http://wiki.openstreetmap.org/wiki/Key:sport),
[`tourism`](http://wiki.openstreetmap.org/wiki/Key:tourism),
[`barrier`](http://wiki.openstreetmap.org/wiki/Key:barrier),
[`historic`](http://wiki.openstreetmap.org/wiki/Key:historic),
[`information`](http://wiki.openstreetmap.org/wiki/Key:information),
[`religion`](http://wiki.openstreetmap.org/wiki/Key:religion)
or [`shop`](http://wiki.openstreetmap.org/wiki/Key:shop)
[`landuse`](http://wiki.openstreetmap.org/wiki/Key:landuse),
[`leisure`](http://wiki.openstreetmap.org/wiki/Key:leisure),
[`railway`](http://wiki.openstreetmap.org/wiki/Key:railway),
[`shop`](http://wiki.openstreetmap.org/wiki/Key:shop),
[`sport`](http://wiki.openstreetmap.org/wiki/Key:sport),
[`station`](http://wiki.openstreetmap.org/wiki/Key:station),
[`religion`](http://wiki.openstreetmap.org/wiki/Key:religion),
[`tourism`](http://wiki.openstreetmap.org/wiki/Key:tourism),
[`aerialway`](http://wiki.openstreetmap.org/wiki/Key:aerialway),
[`building`](http://wiki.openstreetmap.org/wiki/Key:building),
[`highway`](http://wiki.openstreetmap.org/wiki/Key:highway)
or [`waterway`](http://wiki.openstreetmap.org/wiki/Key:waterway)
tag. Use this to do more precise styling.
rank: |
The POIs are ranked ascending according to their importance within a grid. The `rank` value shows the

Wyświetl plik

@ -42,3 +42,13 @@ CREATE OR REPLACE FUNCTION service_value(service TEXT) RETURNS TEXT AS $$
ELSE NULL
END;
$$ LANGUAGE SQL IMMUTABLE STRICT;
-- Limit surface to only the most important values to ensure
-- we always know the values of surface
CREATE OR REPLACE FUNCTION surface_value(surface TEXT) RETURNS TEXT AS $$
SELECT CASE
WHEN surface IN ('paved', 'asphalt', 'cobblestone', 'concrete', 'concrete:lanes', 'concrete:plates', 'metal', 'paving_stones', 'sett', 'unhewn_cobblestone', 'wood') THEN 'paved'
WHEN surface IN ('unpaved', 'compacted', 'dirt', 'earth', 'fine_gravel', 'grass', 'grass_paver', 'gravel', 'gravel_turf', 'ground', 'ice', 'mud', 'pebblestone', 'salt', 'sand', 'snow', 'woodchips') THEN 'unpaved'
ELSE NULL
END;
$$ LANGUAGE SQL IMMUTABLE STRICT;

Wyświetl plik

@ -8,7 +8,7 @@ $$ LANGUAGE SQL IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION layer_transportation(bbox geometry, zoom_level int)
RETURNS TABLE(osm_id bigint, geometry geometry, class text, subclass text,
ramp int, oneway int, brunnel TEXT, service TEXT, layer INT, level INT,
indoor INT) AS $$
indoor INT, surface TEXT) AS $$
SELECT
osm_id, geometry,
CASE
@ -33,7 +33,8 @@ indoor INT) AS $$
NULLIF(service, '') AS service,
NULLIF(layer, 0) AS layer,
"level",
CASE WHEN indoor=TRUE THEN 1 ELSE NULL END as indoor
CASE WHEN indoor=TRUE THEN 1 ELSE NULL END as indoor,
NULLIF(surface, '') AS surface
FROM (
-- etldoc: osm_transportation_merge_linestring_gen7 -> layer_transportation:z4
SELECT
@ -44,6 +45,7 @@ indoor INT) AS $$
NULL::boolean AS is_ford,
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 AS surface,
z_order
FROM osm_transportation_merge_linestring_gen7
WHERE zoom_level = 4
@ -58,7 +60,7 @@ indoor INT) AS $$
NULL::boolean AS is_ford,
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,
z_order
NULL AS surface, z_order
FROM osm_transportation_merge_linestring_gen6
WHERE zoom_level = 5
UNION ALL
@ -72,7 +74,7 @@ indoor INT) AS $$
NULL::boolean AS is_ford,
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,
z_order
NULL AS surface, z_order
FROM osm_transportation_merge_linestring_gen5
WHERE zoom_level = 6
UNION ALL
@ -86,7 +88,7 @@ indoor INT) AS $$
NULL::boolean AS is_ford,
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,
z_order
NULL AS surface, z_order
FROM osm_transportation_merge_linestring_gen4
WHERE zoom_level = 7
UNION ALL
@ -100,7 +102,7 @@ indoor INT) AS $$
NULL::boolean AS is_ford,
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,
z_order
NULL AS surface, z_order
FROM osm_transportation_merge_linestring_gen3
WHERE zoom_level = 8
UNION ALL
@ -115,7 +117,7 @@ indoor INT) AS $$
NULL::boolean AS is_ford,
NULL::boolean AS is_ramp, NULL::int AS is_oneway, NULL as man_made,
layer, NULL::int AS level, NULL::boolean AS indoor,
z_order
NULL AS surface, z_order
FROM osm_highway_linestring_gen2
WHERE zoom_level BETWEEN 9 AND 10
AND st_length(geometry)>zres(11)
@ -130,7 +132,7 @@ indoor INT) AS $$
NULL::boolean AS is_ford,
NULL::boolean AS is_ramp, NULL::int AS is_oneway, NULL as man_made,
layer, NULL::int AS level, NULL::boolean AS indoor,
z_order
NULL AS surface, z_order
FROM osm_highway_linestring_gen1
WHERE zoom_level = 11
AND st_length(geometry)>zres(12)
@ -151,6 +153,7 @@ indoor INT) AS $$
CASE WHEN highway IN ('footway', 'steps') THEN indoor
ELSE NULL::boolean
END AS indoor,
surface_value(surface) AS "surface",
z_order
FROM osm_highway_linestring
WHERE NOT is_area AND (
@ -182,7 +185,7 @@ indoor INT) AS $$
NULL::boolean AS is_ford,
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,
z_order
NULL as surface, z_order
FROM osm_railway_linestring_gen5
WHERE zoom_level = 8
AND railway='rail' AND service = '' and usage='main'
@ -197,7 +200,7 @@ indoor INT) AS $$
NULL::boolean AS is_ford,
NULL::boolean AS is_ramp, NULL::int AS is_oneway, NULL as man_made,
layer, NULL::int AS level, NULL::boolean AS indoor,
z_order
NULL AS surface, z_order
FROM osm_railway_linestring_gen4
WHERE zoom_level = 9
AND railway='rail' AND service = '' and usage='main'
@ -210,7 +213,7 @@ indoor INT) AS $$
NULL AS public_transport, service_value(service) AS service,
is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made,
layer, NULL::int AS level, NULL::boolean AS indoor,
z_order
NULL AS surface, z_order
FROM osm_railway_linestring_gen3
WHERE zoom_level = 10
AND railway IN ('rail', 'narrow_gauge') AND service = ''
@ -223,7 +226,7 @@ indoor INT) AS $$
NULL AS public_transport, service_value(service) AS service,
is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made,
layer, NULL::int AS level, NULL::boolean AS indoor,
z_order
NULL as surface, z_order
FROM osm_railway_linestring_gen2
WHERE zoom_level = 11
AND railway IN ('rail', 'narrow_gauge', 'light_rail') AND service = ''
@ -236,7 +239,7 @@ indoor INT) AS $$
NULL AS public_transport, service_value(service) AS service,
is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made,
layer, NULL::int AS level, NULL::boolean AS indoor,
z_order
NULL as surface, z_order
FROM osm_railway_linestring_gen1
WHERE zoom_level = 12
AND railway IN ('rail', 'narrow_gauge', 'light_rail') AND service = ''
@ -250,7 +253,7 @@ indoor INT) AS $$
NULL AS public_transport, service_value(service) AS service,
is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made,
layer, NULL::int AS level, NULL::boolean AS indoor,
z_order
NULL as surface, z_order
FROM osm_railway_linestring
WHERE zoom_level = 13
AND railway IN ('rail', 'narrow_gauge', 'light_rail') AND service = ''
@ -264,7 +267,7 @@ indoor INT) AS $$
NULL AS public_transport, service_value(service) AS service,
is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made,
layer, NULL::int AS level, NULL::boolean AS indoor,
z_order
NULL AS surface, z_order
FROM osm_aerialway_linestring_gen1
WHERE zoom_level = 12
UNION ALL
@ -277,7 +280,7 @@ indoor INT) AS $$
NULL AS public_transport, service_value(service) AS service,
is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made,
layer, NULL::int AS level, NULL::boolean AS indoor,
z_order
NULL AS surface, z_order
FROM osm_aerialway_linestring
WHERE zoom_level >= 13
UNION ALL
@ -289,7 +292,7 @@ indoor INT) AS $$
NULL AS public_transport, service_value(service) AS service,
is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made,
layer, NULL::int AS level, NULL::boolean AS indoor,
z_order
NULL AS surface, z_order
FROM osm_shipway_linestring_gen2
WHERE zoom_level = 11
UNION ALL
@ -301,7 +304,7 @@ indoor INT) AS $$
NULL AS public_transport, service_value(service) AS service,
is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made,
layer, NULL::int AS level, NULL::boolean AS indoor,
z_order
NULL AS surface, z_order
FROM osm_shipway_linestring_gen1
WHERE zoom_level = 12
UNION ALL
@ -314,7 +317,7 @@ indoor INT) AS $$
NULL AS public_transport, service_value(service) AS service,
is_bridge, is_tunnel, is_ford, is_ramp, is_oneway, NULL as man_made,
layer, NULL::int AS level, NULL::boolean AS indoor,
z_order
NULL AS surface, z_order
FROM osm_shipway_linestring
WHERE zoom_level >= 13
UNION ALL
@ -334,7 +337,7 @@ indoor INT) AS $$
END AS is_bridge, FALSE AS is_tunnel, FALSE AS is_ford,
FALSE AS is_ramp, FALSE::int AS is_oneway, man_made,
layer, NULL::int AS level, NULL::boolean AS indoor,
z_order
NULL AS surface, z_order
FROM osm_highway_polygon
-- We do not want underground pedestrian areas for now
WHERE zoom_level >= 13

Wyświetl plik

@ -133,6 +133,10 @@ man_made_field: &man_made
z_order_field: &z_order
name: z_order
type: wayzorder
surface_field: &surface
key: surface
name: surface
type: string
tables:
# etldoc: imposm3 -> osm_highway_linestring
@ -168,6 +172,7 @@ tables:
- *usage
- *public_transport
- *man_made
- *surface
mapping:
highway:
- motorway

Wyświetl plik

@ -105,10 +105,16 @@ layer:
value of [`indoor`](http://wiki.openstreetmap.org/wiki/Key:indoor) tag.
values:
- 1
surface:
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:
- paved
- unpaved
datasource:
geometry_field: geometry
srid: 900913
query: (SELECT geometry, class, subclass, oneway, ramp, brunnel, service, layer, level, indoor FROM layer_transportation(!bbox!, z(!scale_denominator!))) AS t
query: (SELECT geometry, class, subclass, oneway, ramp, brunnel, service, layer, level, indoor, surface FROM layer_transportation(!bbox!, z(!scale_denominator!))) AS t
schema:
- ./class.sql
- ./update_transportation_merge.sql