Skip to content

Commit f583358

Browse files
simsuracecaptchanjack
authored andcommitted
Fix lane parsing bug
1 parent c30254c commit f583358

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

Diff for: src/parse.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ function parse_osm_network_dict(osm_network_dict::AbstractDict,
227227
tags["gauge"] = get(tags, "gauge", nothing)
228228
tags["usage"] = get(tags, "usage", "unknown")
229229
tags["name"] = get(tags, "name", "unknown")
230-
tags["lanes"] = L(get(tags, "tracks", 1))
230+
tags["lanes"] = lanes(tags)
231231
tags["maxspeed"] = maxspeed(tags)
232232
tags["oneway"] = is_oneway(tags)
233233
tags["reverseway"] = is_reverseway(tags)

Diff for: test/graph.jl

+10
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,14 @@ graphs = [
88
@test g.node_to_way === g.node_to_way
99
@test g.edge_to_way === g.edge_to_way
1010
end
11+
end
12+
@testset "Regression test for railway lane parsing" begin
13+
g = graph_from_download(
14+
:place_name,
15+
place_name = "bern, switzerland",
16+
network_type = :rail,
17+
weight_type = :distance
18+
)
19+
_, way = rand(g.ways)
20+
@test way.tags["lanes"] isa Integer
1121
end

0 commit comments

Comments
 (0)