Add expressway tagging to the transportation layer (#1313)
Fixes #1148 This PR adds expressway tagging to the `transportation` layer, by setting `expressway=1` for non-motorway roads tagged `expressway=yes`, and omitting the tag otherwise. Additionally, I've added a few unit tests to verify that the expressway tagging is being imported and updated into the intermediate tables. Here is an example of expressway tagging on US-1 in Rhode Island, USA: 
This commit is contained in:
committed by
GitHub
parent
ec74480414
commit
7f23feab88
@@ -37,6 +37,7 @@
|
||||
<nd ref="500011" />
|
||||
<nd ref="500012" />
|
||||
<tag k="highway" v="trunk"/>
|
||||
<tag k="expressway" v="yes"/>
|
||||
<tag k="name" v="OpenMapTiles Trunk"/>
|
||||
</way>
|
||||
<way id="5002" version="1" timestamp="2019-01-01T00:00:00Z" visible="true">
|
||||
|
||||
@@ -133,6 +133,13 @@ BEGIN
|
||||
INSERT INTO omt_test_failures VALUES(500, 'import', 'osm_transportation_linestring z9 import tags expected 1, got ' || cnt);
|
||||
END IF;
|
||||
|
||||
SELECT COUNT(*) INTO cnt FROM osm_transportation_merge_linestring_gen_z9
|
||||
WHERE highway = 'trunk'
|
||||
AND expressway = TRUE;
|
||||
IF cnt < 1 THEN
|
||||
INSERT INTO omt_test_failures VALUES(500, 'import', 'osm_transportation_linestring z9 import expressway expected >=1, got ' || cnt);
|
||||
END IF;
|
||||
|
||||
-- Same-named road split into 3 parts, because the middle segment is tagged toll=yes
|
||||
SELECT COUNT(*) INTO cnt FROM osm_transportation_name_linestring WHERE tags->'name' = 'OpenMapTiles Secondary 3';
|
||||
IF cnt <> 2 THEN
|
||||
|
||||
@@ -55,6 +55,14 @@ BEGIN
|
||||
INSERT INTO omt_test_failures VALUES(500, 'update', 'osm_transportation_linestring unsplit road count expected 1, got ' || cnt);
|
||||
END IF;
|
||||
|
||||
-- Verify expressway tag updated
|
||||
SELECT COUNT(*) INTO cnt FROM osm_transportation_merge_linestring_gen_z9
|
||||
WHERE highway = 'primary'
|
||||
AND expressway = TRUE;
|
||||
IF cnt < 1 THEN
|
||||
INSERT INTO omt_test_failures VALUES(500, 'import', 'osm_transportation_linestring z9 update expressway expected >=1, got ' || cnt);
|
||||
END IF;
|
||||
|
||||
-- Verify tags changed
|
||||
SELECT COUNT(*) INTO cnt FROM osm_transportation_merge_linestring_gen_z9
|
||||
WHERE is_tunnel = TRUE
|
||||
|
||||
@@ -5,6 +5,13 @@
|
||||
Change tags
|
||||
-->
|
||||
<modify>
|
||||
<way id="5002" version="1" timestamp="2019-01-01T00:00:00Z" visible="true">
|
||||
<nd ref="500021" />
|
||||
<nd ref="500022" />
|
||||
<tag k="highway" v="primary"/>
|
||||
<tag k="expressway" v="yes"/>
|
||||
<tag k="name" v="OpenMapTiles Primary"/>
|
||||
</way>
|
||||
<!-- Change tags -->
|
||||
<way id="5003" version="2" timestamp="2020-01-02T00:00:00Z" visible="true">
|
||||
<nd ref="500031" />
|
||||
|
||||
Reference in New Issue
Block a user