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.
This commit is contained in:
parent
2d0b7159d0
commit
ca9e8f4e52
@ -9,6 +9,7 @@ def_poi_mapping_aerialway: &poi_mapping_aerialway
|
|||||||
# amenity values , see http://taginfo.openstreetmap.org/keys/amenity#values
|
# amenity values , see http://taginfo.openstreetmap.org/keys/amenity#values
|
||||||
def_poi_mapping_amenity: &poi_mapping_amenity
|
def_poi_mapping_amenity: &poi_mapping_amenity
|
||||||
- arts_centre
|
- arts_centre
|
||||||
|
- atm
|
||||||
- bank
|
- bank
|
||||||
- bar
|
- bar
|
||||||
- bbq
|
- bbq
|
||||||
@ -367,6 +368,12 @@ def_poi_fields: &poi_fields
|
|||||||
- name: sport
|
- name: sport
|
||||||
key: sport
|
key: sport
|
||||||
type: string
|
type: string
|
||||||
|
- name: operator
|
||||||
|
key: operator
|
||||||
|
type: string
|
||||||
|
- name: network
|
||||||
|
key: network
|
||||||
|
type: string
|
||||||
|
|
||||||
def_poi_mapping: &poi_mapping
|
def_poi_mapping: &poi_mapping
|
||||||
aerialway: *poi_mapping_aerialway
|
aerialway: *poi_mapping_aerialway
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 1.4 MiB |
@ -94,6 +94,8 @@ layer:
|
|||||||
subclass: ['swimming_area', 'swimming']
|
subclass: ['swimming_area', 'swimming']
|
||||||
castle:
|
castle:
|
||||||
subclass: ['castle', 'ruins']
|
subclass: ['castle', 'ruins']
|
||||||
|
atm:
|
||||||
|
subclass: ['atm']
|
||||||
subclass:
|
subclass:
|
||||||
description: |
|
description: |
|
||||||
Original value of either the
|
Original value of either the
|
||||||
|
|||||||
@ -15,6 +15,18 @@ BEGIN
|
|||||||
WHERE funicular = 'yes'
|
WHERE funicular = 'yes'
|
||||||
AND subclass = 'station';
|
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
|
UPDATE osm_poi_point
|
||||||
SET tags = update_tags(tags, geometry)
|
SET tags = update_tags(tags, geometry)
|
||||||
WHERE COALESCE(tags->'name:latin', tags->'name:nonlatin', tags->'name_int') IS NULL
|
WHERE COALESCE(tags->'name:latin', tags->'name:nonlatin', tags->'name_int') IS NULL
|
||||||
|
|||||||
16
tests/import/600_import-poi.osm
Normal file
16
tests/import/600_import-poi.osm
Normal file
@ -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>
|
||||||
@ -160,6 +160,16 @@ BEGIN
|
|||||||
INSERT INTO omt_test_failures VALUES(500, 'import', 'osm_transportation_name_linestring z12 route_rank expected 1, got ' || cnt);
|
INSERT INTO omt_test_failures VALUES(500, 'import', 'osm_transportation_name_linestring z12 route_rank expected 1, got ' || cnt);
|
||||||
END IF;
|
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;
|
END;
|
||||||
|
|
||||||
$$
|
$$
|
||||||
|
|||||||
@ -76,6 +76,22 @@ BEGIN
|
|||||||
INSERT INTO omt_test_failures VALUES(500, 'update', 'osm_transportation_linestring z9 update tags expected 1, got ' || cnt);
|
INSERT INTO omt_test_failures VALUES(500, 'update', 'osm_transportation_linestring z9 update tags expected 1, got ' || cnt);
|
||||||
END IF;
|
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;
|
END;
|
||||||
|
|
||||||
$$;
|
$$;
|
||||||
|
|||||||
13
tests/update/600_update-poi.osc
Normal file
13
tests/update/600_update-poi.osc
Normal file
@ -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>
|
||||||
Loading…
x
Reference in New Issue
Block a user