Skip to content

Commit

Permalink
fix: avoid unwanted keywords for Restriction struct
Browse files Browse the repository at this point in the history
  • Loading branch information
Anh Hoang authored and captchanjack committed Feb 16, 2025
1 parent 0ffe96e commit ccd8d63
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "LightOSM"
uuid = "d1922b25-af4e-4ba3-84af-fe9bea896051"
authors = ["Jack Chan <jchan2@deloitte.com.au>"]
version = "0.3.1"
version = "0.3.2"

[deps]
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Expand Down
6 changes: 5 additions & 1 deletion src/parse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,9 @@ function parse_osm_network_dict(osm_network_dict::AbstractDict,
)
end
end

restrictions = Dict{T,Restriction{T}}()
restriction_fields = fieldnames(Restriction)
if haskey(osm_network_dict, "relation")
for relation in osm_network_dict["relation"]
if haskey(relation, "tags") && haskey(relation, "members")
Expand All @@ -262,6 +263,9 @@ function parse_osm_network_dict(osm_network_dict::AbstractDict,
restriction_kwargs = DefaultDict(Vector)
for member in members
key = "$(member["role"])_$(member["type"])"
if !(Symbol(key) in restriction_fields)
continue
end
if key == "via_way"
push!(restriction_kwargs[Symbol(key)], member["ref"])
else
Expand Down

0 comments on commit ccd8d63

Please sign in to comment.