Skip to content

Commit 3eb2102

Browse files
authored
Stop area relations with only stops or platforms should be imported (#700)
Fixes #699 group: https://www.openstreetmap.org/relation/17749930 stop area with only stops: https://www.openstreetmap.org/relation/17749926 On http://localhost:8000/#view=17.27/41.643986/-0.89179 <img width="970" height="650" alt="image" src="https://github.com/user-attachments/assets/487c0de0-a84d-412a-ac84-0aa6efb06516" />
1 parent 6bac9be commit 3eb2102

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

import/openrailwaymap.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,8 +1453,10 @@ function osm2pgsql.process_relation(object)
14531453
for _, member in ipairs(object.members) do
14541454
if member.role == 'stop' and member.type == 'n' then
14551455
table.insert(stop_members, member.ref)
1456+
has_members = true
14561457
elseif member.role == 'platform' then
14571458
table.insert(platform_members, member.ref)
1459+
has_members = true
14581460
elseif member.type == 'n' then
14591461
-- Station has no role defined
14601462
table.insert(node_members, member.ref)

import/test/test_import_stop_area.lua

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,21 @@ assert.eq(osm2pgsql.get_and_clear_imported_data(), {
5454
},
5555
})
5656

57+
osm2pgsql.process_relation({
58+
tags = {
59+
['type'] = 'public_transport',
60+
['public_transport'] = 'stop_area',
61+
},
62+
members = {
63+
{ role = 'stop', type = 'n', ref = 1 },
64+
},
65+
})
66+
assert.eq(osm2pgsql.get_and_clear_imported_data(), {
67+
stop_areas = {
68+
{ stop_ref_ids = '{1}', way_ref_ids = '{}', platform_ref_ids = '{}', node_ref_ids = '{}' },
69+
},
70+
})
71+
5772
-- Stop area groups
5873

5974
osm2pgsql.process_relation({

0 commit comments

Comments
 (0)