Add POI parcel locker (#1390)
closes #1370 This PR adds a parcel locker to post class. Similarly to ATMs from PR #1375 if a name is not present we try to use `brand` or `operator`. Here we also try to add `ref` to the brand or operator since it can disambiguate parcel lockers that are next to each other (which happens).
This commit is contained in:
@@ -13,4 +13,19 @@
|
||||
<tag k="amenity" v="atm"/>
|
||||
<tag k="network" v="OpenMapTiles ATM"/>
|
||||
</node>
|
||||
<node id="600004" visible="true" timestamp="2019-01-01T00:00:00Z" version="1" lat="35.5" lon="-80.5">
|
||||
<tag k="amenity" v="parcel_locker"/>
|
||||
<tag k="name" v="OpenMapTiles Parcel Locker"/>
|
||||
<tag k="brand" v="Different operator"/>
|
||||
<tag k="ref" v="PL001"/>
|
||||
</node>
|
||||
<node id="600005" visible="true" timestamp="2019-01-01T00:00:00Z" version="1" lat="35.6" lon="-80.6">
|
||||
<tag k="amenity" v="parcel_locker"/>
|
||||
<tag k="brand" v="OpenMapTiles Parcel Locker"/>
|
||||
<tag k="ref" v="PL002"/>
|
||||
</node>
|
||||
<node id="600006" visible="true" timestamp="2019-01-01T00:00:00Z" version="1" lat="35.7" lon="-80.7">
|
||||
<tag k="amenity" v="parcel_locker"/>
|
||||
<tag k="operator" v="OpenMapTiles Parcel Locker"/>
|
||||
</node>
|
||||
</osm>
|
||||
|
||||
@@ -170,6 +170,20 @@ BEGIN
|
||||
INSERT INTO omt_test_failures VALUES(600, 'import', 'osm_poi_point atm with name "OpenMapTiles ATM" expected 3, got ' || cnt);
|
||||
END IF;
|
||||
|
||||
-- verify that parcel lockers are imported with correct name which can come from tags like brand or operator and can contain ref
|
||||
SELECT COUNT(*) INTO cnt FROM osm_poi_point
|
||||
WHERE subclass = 'parcel_locker'
|
||||
AND tags->'name' like 'OpenMapTiles Parcel Locker%';
|
||||
IF cnt <> 3 THEN
|
||||
INSERT INTO omt_test_failures VALUES(600, 'import', 'osm_poi_point parcel_locker with name like "OpenMapTiles Parcel Locker%" expected 3, got ' || cnt);
|
||||
END IF;
|
||||
SELECT COUNT(*) INTO cnt FROM osm_poi_point
|
||||
WHERE subclass = 'parcel_locker'
|
||||
AND tags->'name' like 'OpenMapTiles Parcel Locker PL00%';
|
||||
IF cnt <> 1 THEN
|
||||
INSERT INTO omt_test_failures VALUES(600, 'import', 'osm_poi_point parcel_locker with name like "OpenMapTiles Parcel Locker PL00%" expected 1, got ' || cnt);
|
||||
END IF;
|
||||
|
||||
END;
|
||||
|
||||
$$
|
||||
|
||||
@@ -79,6 +79,7 @@ BEGIN
|
||||
-- Test 600
|
||||
|
||||
-- check if name was applied correctly
|
||||
-- for atm
|
||||
SELECT COUNT(*) INTO cnt FROM osm_poi_point
|
||||
WHERE subclass = 'atm'
|
||||
AND tags->'name' = 'OpenMapTiles ATM';
|
||||
@@ -91,6 +92,20 @@ BEGIN
|
||||
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;
|
||||
|
||||
-- for parcel_locker
|
||||
SELECT COUNT(*) INTO cnt FROM osm_poi_point
|
||||
WHERE subclass = 'parcel_locker'
|
||||
AND tags->'name' like 'OpenMapTiles Parcel Locker%';
|
||||
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 = 'parcel_locker'
|
||||
AND tags->'name' = 'Different operator PL001';
|
||||
IF cnt <> 1 THEN
|
||||
INSERT INTO omt_test_failures VALUES(600, 'update', 'osm_poi_point parcel_locker with name "Different operator PL001" expected 1, got ' || cnt);
|
||||
END IF;
|
||||
|
||||
END;
|
||||
|
||||
|
||||
@@ -3,11 +3,17 @@
|
||||
<!--
|
||||
Test 600: POIs
|
||||
Change atm's network
|
||||
Remove Parcel locker name and leave brand
|
||||
-->
|
||||
<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>
|
||||
<node id="600004" visible="true" timestamp="2020-01-02T00:00:00Z" version="1" lat="35.4" lon="-80.4">
|
||||
<tag k="amenity" v="parcel_locker"/>
|
||||
<tag k="brand" v="Different operator"/>
|
||||
<tag k="ref" v="PL001"/>
|
||||
</node>
|
||||
</modify>
|
||||
</osmChange>
|
||||
|
||||
Reference in New Issue
Block a user