feat: add charging station to car POIs (#1544)

Adding charging station to class `fuel`.

Co-authored-by: Christopher Beddow <cbeddow>
Co-authored-by: Tomas Pohanka <TomPohys@gmail.com>
This commit is contained in:
Christopher Beddow
2023-12-12 13:58:03 +01:00
committed by GitHub
parent 3cf77e2a54
commit e61442c49d
10 changed files with 93 additions and 5 deletions

View File

@@ -28,4 +28,28 @@
<tag k="amenity" v="parcel_locker"/>
<tag k="operator" v="OpenMapTiles Parcel Locker"/>
</node>
<node id="600007" visible="true" timestamp="2019-01-01T00:00:00Z" version="1" lat="35.8" lon="-80.8">
<tag k="amenity" v="charging_station"/>
<tag k="name" v="OpenMapTiles Charging Station"/>
<tag k="brand" v="OpenMapTiles Charging Station Brand"/>
</node>
<node id="600008" visible="true" timestamp="2019-01-01T00:00:00Z" version="1" lat="34.0" lon="-80.0" />
<node id="600009" visible="true" timestamp="2019-01-01T00:00:00Z" version="1" lat="34.1" lon="-80.0" />
<node id="600010" visible="true" timestamp="2019-01-01T00:00:00Z" version="1" lat="34.1" lon="-80.1" />
<node id="600011" visible="true" timestamp="2019-01-01T00:00:00Z" version="1" lat="34.0" lon="-80.1" />
</node>
<node id="6000012" visible="true" timestamp="2019-01-01T00:00:00Z" version="1" lat="35.9" lon="-80.9">
<tag k="amenity" v="charging_station"/>
<tag k="name" v="OpenMapTiles Charging Station"/>
<tag k="operator" v="OpenMapTiles Charging Station Operator"/>
</node>
<way id="6000" timestamp="2019-01-01T00:00:00Z" version="1" visible="true">
<nd ref="600008" />
<nd ref="600009" />
<nd ref="600010" />
<nd ref="600011" />
<nd ref="600008" />
<tag k="amenity" v="charging_station"/>
<tag k="brand" v="OpenMapTiles Charging Station Brand"/>
</way>
</osm>

View File

@@ -195,6 +195,20 @@ BEGIN
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;
-- verify that charging stations 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 = 'charging_station'
AND tags->'name' = 'OpenMapTiles Charging Station';
IF cnt <> 2 THEN
INSERT INTO omt_test_failures VALUES(600, 'import', 'osm_poi_point charging_station with name "OpenMapTiles Charging Station" expected 2, got ' || cnt);
END IF;
SELECT COUNT(*) INTO cnt FROM osm_poi_polygon
WHERE subclass = 'charging_station'
AND tags->'name' = 'OpenMapTiles Charging Station Brand';
IF cnt <> 1 THEN
INSERT INTO omt_test_failures VALUES(600, 'import', 'osm_poi_polygon charging_station with name "OpenMapTiles Charging Station Brand" expected 1, got ' || cnt);
END IF;
END;

View File

@@ -98,7 +98,7 @@ BEGIN
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);
INSERT INTO omt_test_failures VALUES(600, 'update', 'osm_poi_point atm with name "OpenMapTiles Parcel Locker%" expected 2, got ' || cnt);
END IF;
SELECT COUNT(*) INTO cnt FROM osm_poi_point
WHERE subclass = 'parcel_locker'
@@ -107,6 +107,26 @@ BEGIN
INSERT INTO omt_test_failures VALUES(600, 'update', 'osm_poi_point parcel_locker with name "Different operator PL001" expected 1, got ' || cnt);
END IF;
-- for charging_station
SELECT COUNT(*) INTO cnt FROM osm_poi_point
WHERE subclass = 'charging_station'
AND tags->'name' = 'OpenMapTiles Charging Station';
IF cnt <> 1 THEN
INSERT INTO omt_test_failures VALUES(600, 'update', 'osm_poi_point charging_station with name "OpenMapTiles Charging Station" expected 1, got ' || cnt);
END IF;
SELECT COUNT(*) INTO cnt FROM osm_poi_point
WHERE subclass = 'charging_station'
AND tags->'name' = 'OpenMapTiles Charging Station Brand';
IF cnt <> 1 THEN
INSERT INTO omt_test_failures VALUES(600, 'update', 'osm_poi_point charging_station with name "OpenMapTiles Charging Station Brand" expected 1, got ' || cnt);
END IF;
SELECT COUNT(*) INTO cnt FROM osm_poi_polygon
WHERE subclass = 'charging_station'
AND tags->'name' = 'OpenMapTiles Charging Station';
IF cnt <> 1 THEN
INSERT INTO omt_test_failures VALUES(600, 'update', 'osm_poi_polygon charging_station with name "OpenMapTiles Charging Station" expected 1, got ' || cnt);
END IF;
END;
$$;

View File

@@ -15,5 +15,18 @@
<tag k="brand" v="Different operator"/>
<tag k="ref" v="PL001"/>
</node>
<node id="600007" visible="true" timestamp="2020-01-02T00:00:00Z" version="1" lat="35.8" lon="-80.8">
<tag k="amenity" v="charging_station"/>
<tag k="brand" v="OpenMapTiles Charging Station Brand"/>
</node>
<way id="6000" timestamp="2020-01-02T00:00:00Z" version="1" visible="true">
<nd ref="600008" />
<nd ref="600009" />
<nd ref="600010" />
<nd ref="600011" />
<nd ref="600008" />
<tag k="amenity" v="charging_station"/>
<tag k="name" v="OpenMapTiles Charging Station"/>
</way>
</modify>
</osmChange>