Skip to content

Commit 0563f27

Browse files
authored
Do not import bus/taxy/ferry-only platforms (#589)
Fixes #575 Always import `railway = platform`. For `public_transport = platform`: - Always import if `train = yes` - Always import if `tram = yes` - Always import if `subway = yes` - Always import if `light_rail = yes` - Else, do not import if any of `bus = yes` or `trolleybus = yes` or `share_taxi = yes` or `ferry = yes`. Also see https://taginfo.openstreetmap.org/tags/public_transport=platform#combinations (https://openrailwaymap.app/#view=18.46/52.5287048/13.3768069) Before: <img width="1099" height="829" alt="image" src="https://github.com/user-attachments/assets/ea1c003d-e516-49c6-a12d-2bff5bf5b0a1" /> After: <img width="1281" height="759" alt="image" src="https://github.com/user-attachments/assets/495a08ce-15e4-4a6c-85dd-d03391061784" />
1 parent 10ddb3a commit 0563f27

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

import/openrailwaymap.lua

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,26 @@ function format_railway_position(item)
825825
end
826826
end
827827

828+
function is_railway_platform(tags)
829+
-- Ignore non-railway platforms
830+
return tags.railway == 'platform'
831+
or (
832+
tags.public_transport == 'platform'
833+
and (
834+
tags.train == 'yes'
835+
or tags.tram == 'yes'
836+
or tags.subway == 'yes'
837+
or tags.light_rail == 'yes'
838+
or not (
839+
tags.bus == 'yes'
840+
or tags.trolleybus == 'yes'
841+
or tags.share_taxi == 'yes'
842+
or tags.ferry == 'yes'
843+
)
844+
)
845+
)
846+
end
847+
828848
local railway_station_values = osm2pgsql.make_check_values_func({'station', 'halt', 'tram_stop', 'service_station', 'yard', 'junction', 'spur_junction', 'crossover', 'site'})
829849
local railway_poi_values = osm2pgsql.make_check_values_func(tag_functions.poi_railway_values)
830850
local railway_signal_values = osm2pgsql.make_check_values_func({'signal', 'buffer_stop', 'derail', 'vacancy_detection'})
@@ -924,7 +944,7 @@ function osm2pgsql.process_node(object)
924944
})
925945
end
926946

927-
if tags.public_transport == 'platform' or tags.railway == 'platform' then
947+
if is_railway_platform(tags) then
928948
platforms:insert({
929949
way = object:as_point(),
930950
name = tags.name,
@@ -1165,7 +1185,7 @@ function osm2pgsql.process_way(object)
11651185
end
11661186
end
11671187

1168-
if tags.public_transport == 'platform' or tags.railway == 'platform' then
1188+
if is_railway_platform(tags) then
11691189
platforms:insert({
11701190
way = object:as_polygon(),
11711191
name = tags.name,
@@ -1268,7 +1288,7 @@ local route_platform_relation_roles = osm2pgsql.make_check_values_func({'platfor
12681288
function osm2pgsql.process_relation(object)
12691289
local tags = object.tags
12701290

1271-
if tags.public_transport == 'platform' or tags.railway == 'platform' then
1291+
if is_railway_platform(tags) then
12721292
platforms:insert({
12731293
way = object:as_multipolygon(),
12741294
name = tags.name,

0 commit comments

Comments
 (0)