adds ATM to POI layer (#1375)

This PR adds ATM to POI layer.
If ATM isn't provided with a name tag we'll try to use operator or network instead.
pull/1377/head^2
ttomasz 2022-04-25 10:29:08 +02:00 zatwierdzone przez GitHub
rodzic 2d0b7159d0
commit ca9e8f4e52
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
8 zmienionych plików z 76 dodań i 0 usunięć

Wyświetl plik

@ -9,6 +9,7 @@ def_poi_mapping_aerialway: &poi_mapping_aerialway
# amenity values , see http://taginfo.openstreetmap.org/keys/amenity#values
def_poi_mapping_amenity: &poi_mapping_amenity
- arts_centre
- atm
- bank
- bar
- bbq
@ -367,6 +368,12 @@ def_poi_fields: &poi_fields
- name: sport
key: sport
type: string
- name: operator
key: operator
type: string
- name: network
key: network
type: string
def_poi_mapping: &poi_mapping
aerialway: *poi_mapping_aerialway

Plik binarny nie jest wyświetlany.

Przed

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

Po

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

Wyświetl plik

@ -94,6 +94,8 @@ layer:
subclass: ['swimming_area', 'swimming']
castle:
subclass: ['castle', 'ruins']
atm:
subclass: ['atm']
subclass:
description: |
Original value of either the

Wyświetl plik

@ -15,6 +15,18 @@ BEGIN
WHERE funicular = 'yes'
AND subclass = 'station';
-- ATM without name
-- use either operator or network
-- (using name for ATM is discouraged, see osm wiki)
UPDATE osm_poi_point
SET (name, tags) = (
COALESCE(tags -> 'operator', tags -> 'network'),
tags || hstore('name', COALESCE(tags -> 'operator', tags -> 'network'))
)
WHERE subclass = 'atm'
AND name = ''
AND COALESCE(tags -> 'operator', tags -> 'network') IS NOT NULL;
UPDATE osm_poi_point
SET tags = update_tags(tags, geometry)
WHERE COALESCE(tags->'name:latin', tags->'name:nonlatin', tags->'name_int') IS NULL

Wyświetl plik

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="Manual">
<node id="600001" visible="true" timestamp="2019-01-01T00:00:00Z" version="1" lat="35.2" lon="-80.2">
<tag k="amenity" v="atm"/>
<tag k="name" v="OpenMapTiles ATM"/>
<tag k="operator" v="Different operator"/>
</node>
<node id="600002" visible="true" timestamp="2019-01-01T00:00:00Z" version="1" lat="35.3" lon="-80.3">
<tag k="amenity" v="atm"/>
<tag k="operator" v="OpenMapTiles ATM"/>
</node>
<node id="600003" visible="true" timestamp="2019-01-01T00:00:00Z" version="1" lat="35.4" lon="-80.4">
<tag k="amenity" v="atm"/>
<tag k="network" v="OpenMapTiles ATM"/>
</node>
</osm>

Wyświetl plik

@ -160,6 +160,16 @@ BEGIN
INSERT INTO omt_test_failures VALUES(500, 'import', 'osm_transportation_name_linestring z12 route_rank expected 1, got ' || cnt);
END IF;
-- Test 600
-- verify that atms are imported with correct name which can come from tags like operator or network
SELECT COUNT(*) INTO cnt FROM osm_poi_point
WHERE subclass = 'atm'
AND tags->'name' = 'OpenMapTiles ATM';
IF cnt <> 3 THEN
INSERT INTO omt_test_failures VALUES(600, 'import', 'osm_poi_point atm with name "OpenMapTiles ATM" expected 3, got ' || cnt);
END IF;
END;
$$

Wyświetl plik

@ -76,6 +76,22 @@ BEGIN
INSERT INTO omt_test_failures VALUES(500, 'update', 'osm_transportation_linestring z9 update tags expected 1, got ' || cnt);
END IF;
-- Test 600
-- check if name was applied correctly
SELECT COUNT(*) INTO cnt FROM osm_poi_point
WHERE subclass = 'atm'
AND tags->'name' = 'OpenMapTiles ATM';
IF cnt <> 2 THEN
INSERT INTO omt_test_failures VALUES(600, 'update', 'osm_poi_point atm with name "OpenMapTiles ATM" expected 2, got ' || cnt);
END IF;
SELECT COUNT(*) INTO cnt FROM osm_poi_point
WHERE subclass = 'atm'
AND tags->'name' = 'New name';
IF cnt <> 1 THEN
INSERT INTO omt_test_failures VALUES(600, 'update', 'osm_poi_point atm with name "New name" expected 1, got ' || cnt);
END IF;
END;
$$;

Wyświetl plik

@ -0,0 +1,13 @@
<?xml version='1.0' encoding='UTF-8'?>
<osmChange version="0.6" generator="Manual" timestamp="2020-01-02T00:00:00Z">
<!--
Test 600: POIs
Change atm's network
-->
<modify>
<node id="600003" visible="true" timestamp="2020-01-02T00:00:00Z" version="1" lat="35.4" lon="-80.4">
<tag k="amenity" v="atm"/>
<tag k="network" v="New name"/>
</node>
</modify>
</osmChange>