kopia lustrzana https://github.com/openmaptiles/openmaptiles
Rail stations 2 (#255)
* rail stations * Create 'railway' POI class with 'station' and 'halt' subclasses * Introduce subway stops as POI * Revert unwanted changes in .env and openmaptiles.yaml * Remove halt key from documentation * Distinguish aeroway and railway station, add tram_stoppull/262/head
rodzic
8a44e72328
commit
9584f69035
2
.env
2
.env
|
@ -5,4 +5,4 @@ POSTGRES_HOST=postgres
|
|||
POSTGRES_PORT=5432
|
||||
QUICKSTART_MIN_ZOOM=0
|
||||
QUICKSTART_MAX_ZOOM=7
|
||||
DIFF_MODE=false
|
||||
DIFF_MODE=false
|
||||
|
|
|
@ -4,6 +4,7 @@ RETURNS INT AS $$
|
|||
WHEN 'hospital' THEN 20
|
||||
WHEN 'park' THEN 25
|
||||
WHEN 'cemetery' THEN 30
|
||||
WHEN 'railway' THEN 40
|
||||
WHEN 'bus' THEN 50
|
||||
WHEN 'attraction' THEN 70
|
||||
WHEN 'harbor' THEN 75
|
||||
|
@ -28,7 +29,7 @@ RETURNS INT AS $$
|
|||
END;
|
||||
$$ LANGUAGE SQL IMMUTABLE;
|
||||
|
||||
CREATE OR REPLACE FUNCTION poi_class(subclass TEXT)
|
||||
CREATE OR REPLACE FUNCTION poi_class(subclass TEXT, mapping_key TEXT)
|
||||
RETURNS TEXT AS $$
|
||||
SELECT CASE
|
||||
WHEN subclass IN ('accessories','antiques','art','beauty','bed','boutique','camera','carpet','charity','chemist','chocolate','coffee','computer','confectionery','convenience','copyshop','cosmetics','garden_centre','doityourself','erotic','electronics','fabric','florist','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') THEN 'shop'
|
||||
|
@ -37,6 +38,8 @@ RETURNS TEXT AS $$
|
|||
WHEN subclass IN ('fast_food','food_court') THEN 'fast_food'
|
||||
WHEN subclass IN ('park','bbq') THEN 'park'
|
||||
WHEN subclass IN ('bus_stop','bus_station') THEN 'bus'
|
||||
-- because 'station' might be from both aeroway and railway
|
||||
WHEN (subclass='station' AND mapping_key = 'railway') OR subclass IN ('halt', 'tram_stop', 'subway') THEN 'railway'
|
||||
WHEN subclass IN ('camp_site','caravan_site') THEN 'campsite'
|
||||
WHEN subclass IN ('laundry','dry_cleaning') THEN 'laundry'
|
||||
WHEN subclass IN ('supermarket','deli','delicatessen','department_store','greengrocer','marketplace') THEN 'grocery'
|
||||
|
|
|
@ -7,10 +7,10 @@ RETURNS TABLE(osm_id bigint, geometry geometry, name text, name_en text, name_de
|
|||
SELECT osm_id, geometry, NULLIF(name, '') AS name,
|
||||
COALESCE(NULLIF(name_en, ''), name) AS name_en,
|
||||
COALESCE(NULLIF(name_de, ''), name, name_en) AS name_de,
|
||||
poi_class(subclass) AS class, subclass,
|
||||
poi_class(subclass, mapping_key) AS class, subclass,
|
||||
row_number() OVER (
|
||||
PARTITION BY LabelGrid(geometry, 100 * pixel_width)
|
||||
ORDER BY CASE WHEN name = '' THEN 2000 ELSE poi_class_rank(poi_class(subclass)) END ASC
|
||||
ORDER BY CASE WHEN name = '' THEN 2000 ELSE poi_class_rank(poi_class(subclass, mapping_key)) END ASC
|
||||
)::int AS "rank"
|
||||
FROM (
|
||||
-- etldoc: osm_poi_point -> layer_poi:z14_
|
||||
|
|
|
@ -101,6 +101,12 @@ def_poi_mapping_leisure: &poi_mapping_leisure
|
|||
- swimming_pool
|
||||
- water_park
|
||||
|
||||
# railway values , see http://taginfo.openstreetmap.org/keys/railway#values
|
||||
def_poi_mapping_railway: &poi_mapping_railway
|
||||
- station
|
||||
- halt
|
||||
- tram_stop
|
||||
|
||||
# shop values , see http://taginfo.openstreetmap.org/keys/shop#values
|
||||
def_poi_mapping_shop: &poi_mapping_shop
|
||||
- accessories
|
||||
|
@ -311,6 +317,11 @@ tables:
|
|||
type: string
|
||||
- name: subclass
|
||||
type: mapping_value
|
||||
- name: mapping_key
|
||||
type: mapping_key
|
||||
- name: station
|
||||
key: station
|
||||
type: string
|
||||
mapping:
|
||||
aerialway: *poi_mapping_aerialway
|
||||
amenity: *poi_mapping_amenity
|
||||
|
@ -319,6 +330,7 @@ tables:
|
|||
historic: *poi_mapping_historic
|
||||
landuse: *poi_mapping_landuse
|
||||
leisure: *poi_mapping_leisure
|
||||
railway: *poi_mapping_railway
|
||||
shop: *poi_mapping_shop
|
||||
sport: *poi_mapping_sport
|
||||
tourism: *poi_mapping_tourism
|
||||
|
@ -344,6 +356,11 @@ tables:
|
|||
type: string
|
||||
- name: subclass
|
||||
type: mapping_value
|
||||
- name: mapping_key
|
||||
type: mapping_key
|
||||
- name: station
|
||||
key: station
|
||||
type: string
|
||||
mapping:
|
||||
aerialway: *poi_mapping_aerialway
|
||||
amenity: *poi_mapping_amenity
|
||||
|
@ -352,6 +369,7 @@ tables:
|
|||
historic: *poi_mapping_historic
|
||||
landuse: *poi_mapping_landuse
|
||||
leisure: *poi_mapping_leisure
|
||||
railway: *poi_mapping_railway
|
||||
shop: *poi_mapping_shop
|
||||
sport: *poi_mapping_sport
|
||||
tourism: *poi_mapping_tourism
|
||||
|
|
|
@ -20,6 +20,8 @@ layer:
|
|||
[`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)
|
||||
or [`shop`](http://wiki.openstreetmap.org/wiki/Key:shop)
|
||||
|
@ -34,6 +36,7 @@ layer:
|
|||
srid: 900913
|
||||
query: (SELECT geometry, name, name_en, name_de, class, subclass, rank FROM layer_poi(!bbox!, z(!scale_denominator!), !pixel_width!)) AS t
|
||||
schema:
|
||||
- ./poi_update.sql
|
||||
- ./poi_polygon_update.sql
|
||||
- ./class.sql
|
||||
- ./layer.sql
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
UPDATE osm_poi_point
|
||||
SET subclass = 'subway'
|
||||
WHERE station = 'subway' and subclass='station';
|
||||
UPDATE osm_poi_polygon
|
||||
SET subclass = 'subway'
|
||||
WHERE station = 'subway' and subclass='station';
|
Ładowanie…
Reference in New Issue