Skip to content

Commit

Permalink
Fix lane parsing bug
Browse files Browse the repository at this point in the history
  • Loading branch information
simsurace committed Mar 14, 2024
1 parent c30254c commit c06c573
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/parse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ function parse_osm_network_dict(osm_network_dict::AbstractDict,
tags["gauge"] = get(tags, "gauge", nothing)
tags["usage"] = get(tags, "usage", "unknown")
tags["name"] = get(tags, "name", "unknown")
tags["lanes"] = L(get(tags, "tracks", 1))
tags["lanes"] = lanes(tags)
tags["maxspeed"] = maxspeed(tags)
tags["oneway"] = is_oneway(tags)
tags["reverseway"] = is_reverseway(tags)
Expand Down
10 changes: 10 additions & 0 deletions test/graph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,14 @@ graphs = [
@test g.node_to_way === g.node_to_way
@test g.edge_to_way === g.edge_to_way
end
end
@testset "Regression test for railway lane parsing" begin
g = graph_from_download(
:place_name,
place_name = "bern, switzerland",
network_type = :rail,
weight_type = :distance
)
_, way = rand(g.ways)
@test way.tags["lanes"] isa Integer
end

0 comments on commit c06c573

Please sign in to comment.