Merge branch 'master' into gh-master
# Conflicts: # Makefile # layers/landuse/landuse.sql # layers/poi/poi.sql
This commit is contained in:
@@ -1,12 +1,21 @@
|
||||
CREATE OR REPLACE FUNCTION poi_class_rank(class text)
|
||||
CREATE OR REPLACE FUNCTION poi_class_rank(class text, subclass text)
|
||||
RETURNS int AS
|
||||
$$
|
||||
SELECT CASE class
|
||||
WHEN 'hospital' THEN 20
|
||||
WHEN 'airport' THEN 30
|
||||
WHEN 'railway' THEN 40
|
||||
WHEN 'bus' THEN 50
|
||||
WHEN 'attraction' THEN 70
|
||||
WHEN 'harbor' THEN 75
|
||||
WHEN 'aerialway' THEN 40
|
||||
WHEN 'heliport' THEN 45
|
||||
WHEN 'taxi' THEN 50
|
||||
WHEN 'harbor' THEN 55
|
||||
WHEN 'library' THEN 60
|
||||
WHEN 'bus' THEN
|
||||
CASE subclass
|
||||
WHEN 'bus_station' THEN 70
|
||||
ELSE 72
|
||||
END
|
||||
WHEN 'attraction' THEN 75
|
||||
WHEN 'college' THEN 80
|
||||
WHEN 'school' THEN 85
|
||||
WHEN 'stadium' THEN 90
|
||||
@@ -19,17 +28,51 @@ SELECT CASE class
|
||||
WHEN 'police' THEN 135
|
||||
WHEN 'post' THEN 140
|
||||
WHEN 'golf' THEN 150
|
||||
WHEN 'shop' THEN 400
|
||||
WHEN 'grocery' THEN 500
|
||||
WHEN 'fast_food' THEN 600
|
||||
WHEN 'clothing_store' THEN 700
|
||||
WHEN 'bar' THEN 800
|
||||
WHEN 'entrance' THEN 250
|
||||
WHEN 'parking' THEN 300
|
||||
WHEN 'car_parking' THEN 300
|
||||
WHEN 'fuel' THEN 350
|
||||
WHEN 'charging_station' THEN 355
|
||||
WHEN 'bicycle_parking' THEN 360
|
||||
WHEN 'motorcycle_parking' THEN 360
|
||||
WHEN 'bank' THEN 380
|
||||
WHEN 'art_gallery' THEN 400
|
||||
WHEN 'information' THEN 420
|
||||
WHEN 'fast_food' THEN 430
|
||||
WHEN 'ice_cream' THEN 430
|
||||
WHEN 'bar' THEN 450
|
||||
WHEN 'cafe' THEN 450
|
||||
WHEN 'grocery' THEN 450
|
||||
WHEN 'bakery' THEN 475
|
||||
WHEN 'community_centre' THEN 500
|
||||
WHEN 'shop' THEN 600
|
||||
WHEN 'optician' THEN 600
|
||||
WHEN 'furniture' THEN 600
|
||||
WHEN 'jewelry' THEN 600
|
||||
WHEN 'toys' THEN 600
|
||||
WHEN 'newsagent' THEN 600
|
||||
WHEN 'paint' THEN 600
|
||||
WHEN 'electronics' THEN 600
|
||||
WHEN 'garden_centre' THEN 600
|
||||
WHEN 'mobile_phone' THEN 600
|
||||
WHEN 'shoes' THEN 600
|
||||
WHEN 'clothing_store' THEN 600
|
||||
WHEN 'florist' THEN 600
|
||||
WHEN 'laundry' THEN 700
|
||||
WHEN 'dog_park' THEN 800
|
||||
WHEN 'pitch' THEN 800
|
||||
WHEN 'power_tower' then 900
|
||||
WHEN 'wind_mill' then 900
|
||||
WHEN 'water_tower' then 900
|
||||
WHEN 'communications_tower' then 900
|
||||
WHEN 'wind_turbine' then 900
|
||||
WHEN 'shelter' then 3000
|
||||
ELSE 1000
|
||||
END;
|
||||
$$ LANGUAGE SQL IMMUTABLE
|
||||
PARALLEL SAFE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION poi_class(subclass text, mapping_key text)
|
||||
CREATE OR REPLACE FUNCTION poi_class(subclass text, mapping_key text, subtype text)
|
||||
RETURNS text AS
|
||||
$$
|
||||
SELECT CASE
|
||||
|
||||
@@ -21,6 +21,7 @@ def_poi_mapping_amenity: &poi_mapping_amenity
|
||||
- clinic
|
||||
- college
|
||||
- community_centre
|
||||
- social_facility
|
||||
- courthouse
|
||||
- dentist
|
||||
- doctors
|
||||
@@ -62,6 +63,7 @@ def_poi_mapping_amenity: &poi_mapping_amenity
|
||||
- university
|
||||
- veterinary
|
||||
- waste_basket
|
||||
- charging_station
|
||||
|
||||
# barrier values , see http://taginfo.openstreetmap.org/keys/barrier#values
|
||||
def_poi_mapping_barrier: &poi_mapping_barrier
|
||||
@@ -77,10 +79,13 @@ def_poi_mapping_barrier: &poi_mapping_barrier
|
||||
# building values , see http://taginfo.openstreetmap.org/keys/building#values
|
||||
def_poi_mapping_building: &poi_mapping_building
|
||||
- dormitory
|
||||
- office
|
||||
- industrial
|
||||
|
||||
# highway values , see http://taginfo.openstreetmap.org/keys/highway#values
|
||||
def_poi_mapping_highway: &poi_mapping_highway
|
||||
- bus_stop
|
||||
- speed_camera
|
||||
|
||||
# historic values , see http://taginfo.openstreetmap.org/keys/historic#values
|
||||
def_poi_mapping_historic: &poi_mapping_historic
|
||||
@@ -114,6 +119,7 @@ def_poi_mapping_leisure: &poi_mapping_leisure
|
||||
- swimming_area
|
||||
- swimming_pool
|
||||
- water_park
|
||||
- nature_reserve
|
||||
|
||||
# railway values , see http://taginfo.openstreetmap.org/keys/railway#values
|
||||
def_poi_mapping_railway: &poi_mapping_railway
|
||||
@@ -316,6 +322,24 @@ def_poi_mapping_tourism: &poi_mapping_tourism
|
||||
def_poi_mapping_waterway: &poi_mapping_waterway
|
||||
- dock
|
||||
|
||||
# aeroway values , see http://taginfo.openstreetmap.org/keys/aeroway#values
|
||||
def_poi_mapping_aeroway: &poi_mapping_aeroway
|
||||
- helipad
|
||||
- aerodrome
|
||||
|
||||
# aeroway values , see http://taginfo.openstreetmap.org/keys/aeroway#values
|
||||
def_poi_mapping_power: &poi_mapping_power
|
||||
- generator
|
||||
- tower
|
||||
|
||||
def_poi_mapping_man_made: &poi_mapping_man_made
|
||||
- communications_tower
|
||||
- water_tower
|
||||
- wind_mill
|
||||
|
||||
def_poi_mapping_emergency: &poi_mapping_emergency
|
||||
- defibrillator
|
||||
|
||||
def_poi_fields: &poi_fields
|
||||
- name: osm_id
|
||||
type: id
|
||||
@@ -363,6 +387,12 @@ def_poi_fields: &poi_fields
|
||||
- name: sport
|
||||
key: sport
|
||||
type: string
|
||||
- name: power
|
||||
key: power
|
||||
type: string
|
||||
- name: source
|
||||
key: "generator:source"
|
||||
type: string
|
||||
|
||||
def_poi_mapping: &poi_mapping
|
||||
aerialway: *poi_mapping_aerialway
|
||||
@@ -378,6 +408,10 @@ def_poi_mapping: &poi_mapping
|
||||
sport: *poi_mapping_sport
|
||||
tourism: *poi_mapping_tourism
|
||||
waterway: *poi_mapping_waterway
|
||||
aeroway: *poi_mapping_aeroway
|
||||
power: *poi_mapping_power
|
||||
man_made: *poi_mapping_man_made
|
||||
emergency: *poi_mapping_emergency
|
||||
|
||||
tables:
|
||||
# etldoc: imposm3 -> osm_poi_point
|
||||
|
||||
@@ -26,7 +26,7 @@ SELECT osm_id_hash AS osm_id,
|
||||
COALESCE(NULLIF(name_en, ''), name) AS name_en,
|
||||
COALESCE(NULLIF(name_de, ''), name, name_en) AS name_de,
|
||||
tags,
|
||||
poi_class(subclass, mapping_key) AS class,
|
||||
poi_class(subclass, mapping_key, subtype) AS class,
|
||||
CASE
|
||||
WHEN subclass = 'information'
|
||||
THEN NULLIF(information, '')
|
||||
@@ -34,6 +34,8 @@ SELECT osm_id_hash AS osm_id,
|
||||
THEN NULLIF(religion, '')
|
||||
WHEN subclass = 'pitch'
|
||||
THEN NULLIF(sport, '')
|
||||
WHEN subclass = 'sports_centre'
|
||||
THEN NULLIF(sport, subclass)
|
||||
ELSE subclass
|
||||
END AS subclass,
|
||||
agg_stop,
|
||||
@@ -42,9 +44,33 @@ SELECT osm_id_hash AS osm_id,
|
||||
CASE WHEN indoor = TRUE THEN 1 END AS indoor,
|
||||
row_number() OVER (
|
||||
PARTITION BY LabelGrid(geometry, 100 * pixel_width)
|
||||
ORDER BY CASE WHEN name = '' THEN 2000 ELSE poi_class_rank(poi_class(subclass, mapping_key)) END ASC
|
||||
)::int AS "rank"
|
||||
ORDER BY
|
||||
CASE
|
||||
WHEN name = ''
|
||||
THEN 2000
|
||||
ELSE poi_class_rank(poi_class(
|
||||
subclass,
|
||||
mapping_key,
|
||||
subtype
|
||||
), subclass) END ASC
|
||||
)::int AS "rank"
|
||||
FROM (
|
||||
-- Intermediate mapping for subtype and filtering out nameless industrial/office buildings
|
||||
SELECT *,
|
||||
CASE
|
||||
WHEN subclass = 'information'
|
||||
THEN NULLIF(information, '')
|
||||
WHEN subclass = 'place_of_worship'
|
||||
THEN NULLIF(religion, '')
|
||||
WHEN subclass = 'pitch'
|
||||
THEN NULLIF(sport, '')
|
||||
WHEN subclass = 'sports_centre'
|
||||
THEN NULLIF(sport, '')
|
||||
WHEN subclass = 'generator' AND mapping_key = 'power'
|
||||
THEN NULLIF(source, '')
|
||||
ELSE subclass
|
||||
END as subtype
|
||||
FROM (
|
||||
-- etldoc: osm_poi_point -> layer_poi:z12
|
||||
-- etldoc: osm_poi_point -> layer_poi:z13
|
||||
SELECT *,
|
||||
@@ -92,7 +118,9 @@ FROM (
|
||||
FROM osm_poi_polygon
|
||||
WHERE geometry && bbox
|
||||
AND zoom_level >= 14
|
||||
) AS poi_union
|
||||
) AS poi_union_raw
|
||||
WHERE NOT (mapping_key = 'building' AND (subclass = 'office' OR subclass = 'industrial') AND coalesce(name, name_en, '') = '')
|
||||
) AS poi_union
|
||||
ORDER BY "rank"
|
||||
$$ LANGUAGE SQL STABLE
|
||||
PARALLEL SAFE;
|
||||
|
||||
@@ -18,15 +18,41 @@ layer:
|
||||
values:
|
||||
shop:
|
||||
subclass: ['accessories', 'antiques', 'beauty', 'bed', 'boutique', 'camera', 'carpet', 'charity', 'chemist',
|
||||
'coffee', 'computer', 'convenience', 'copyshop', 'cosmetics', 'garden_centre', 'doityourself',
|
||||
'erotic', 'electronics', 'fabric', 'florist', 'frozen_food', 'furniture', 'video_games', 'video',
|
||||
'general', 'gift', 'hardware', 'hearing_aids', 'hifi', 'ice_cream', 'interior_decoration',
|
||||
'jewelry', 'kiosk', 'lamps', 'mall', 'massage', 'motorcycle', 'mobile_phone', 'newsagent',
|
||||
'optician', 'outdoor', 'perfumery', 'perfume', 'pet', 'photo', 'second_hand', 'shoes', 'sports',
|
||||
'stationery', 'tailor', 'tattoo', 'ticket', 'tobacco', 'toys', 'travel_agency', 'watches',
|
||||
'weapons', 'wholesale']
|
||||
'coffee', 'computer', 'convenience', 'copyshop', 'cosmetics',
|
||||
'erotic', 'fabric', 'frozen_food', 'video_games', 'video', 'general', 'gift',
|
||||
'hearing_aids', 'hifi', 'interior_decoration', 'kiosk', 'lamps', 'mall', 'massage','outdoor',
|
||||
'perfumery', 'perfume', 'pet', 'photo', 'second_hand', 'sports', 'stationery', 'tailor', 'tattoo',
|
||||
'ticket', 'tobacco', 'travel_agency', 'watches', 'weapons', 'wholesale']
|
||||
optician:
|
||||
subclass: ['optician']
|
||||
toys:
|
||||
subclass: ['toys']
|
||||
jewelry:
|
||||
subclass: ['jewelry']
|
||||
furniture:
|
||||
subclass: ['furniture']
|
||||
newsagent:
|
||||
subclass: ['newsagent']
|
||||
paint:
|
||||
subclass: ['paint']
|
||||
beverages:
|
||||
subclass: ['beverages']
|
||||
electronics:
|
||||
subclass: ['electronics']
|
||||
garden_centre:
|
||||
subclass: ['garden_centre']
|
||||
mobile_phone:
|
||||
subclass: ['mobile_phone']
|
||||
shoes:
|
||||
subclass: ['shoes']
|
||||
hardware:
|
||||
subclass: ['hardware', 'doityourself']
|
||||
florist:
|
||||
subclass: ['florist']
|
||||
town_hall:
|
||||
subclass: ['townhall', 'public_building', 'courthouse', 'community_centre']
|
||||
subclass: ['townhall', 'public_building', 'courthouse']
|
||||
community_centre:
|
||||
subclass: ['community_centre', 'social_facility']
|
||||
golf:
|
||||
subclass: ['golf', 'golf_course', 'miniature_golf']
|
||||
fast_food:
|
||||
@@ -59,7 +85,7 @@ layer:
|
||||
lodging:
|
||||
subclass: ['hotel', 'motel', 'bed_and_breakfast', 'guest_house', 'hostel', 'chalet', 'alpine_hut', 'dormitory']
|
||||
ice_cream:
|
||||
subclass: ['chocolate', 'confectionery']
|
||||
subclass: ['chocolate', 'confectionery', 'ice_cream']
|
||||
post:
|
||||
subclass: ['post_box', 'post_office']
|
||||
cafe:
|
||||
@@ -72,8 +98,14 @@ layer:
|
||||
subclass: ['bar', 'nightclub']
|
||||
harbor:
|
||||
subclass: ['marina', 'dock']
|
||||
car:
|
||||
subclass: ['car', 'car_repair', 'car_parts', 'taxi']
|
||||
taxi:
|
||||
subclass: ['taxi']
|
||||
motorcycle_dealer:
|
||||
subclass: ['motorcycle']
|
||||
car_dealer:
|
||||
subclass: ['car', 'car_parts']
|
||||
car_repair:
|
||||
subclass: ['car_repair']
|
||||
hospital:
|
||||
subclass: ['hospital', 'nursing_home', 'clinic']
|
||||
cemetery:
|
||||
@@ -94,6 +126,25 @@ layer:
|
||||
subclass: ['swimming_area', 'swimming']
|
||||
castle:
|
||||
subclass: ['castle', 'ruins']
|
||||
airport:
|
||||
subclass: ['aerodrome']
|
||||
heliport:
|
||||
subclass: ['helipad']
|
||||
wind_turbine:
|
||||
__AND__:
|
||||
subclass: ['generator']
|
||||
subtype: ['wind']
|
||||
mapping_key: ['power']
|
||||
communications_tower:
|
||||
subclass: ['communications_tower']
|
||||
water_tower:
|
||||
subclass: ['water_tower']
|
||||
wind_mill:
|
||||
subclass: ['wind_mill']
|
||||
power_tower:
|
||||
subclass: ['tower']
|
||||
industry:
|
||||
subclass: ['industrial']
|
||||
subclass:
|
||||
description: |
|
||||
Original value of either the
|
||||
|
||||
Reference in New Issue
Block a user