pszufe / OpenStreetMapX.jl

OpenStreetMap (*.osm) support for Julia 1.0 and up
MIT License
119 stars 24 forks source link

where is the first function parameter nodes used in the following code? #17

Open bsnyh opened 4 years ago

bsnyh commented 4 years ago

Hi, I hope I did not misunderstand anything. But In the following code, where is the first function parameter nodes used? I was a bit confused.....

function get_edges(nodes::Dict{Int,T},roadways::Vector{OpenStreetMapX.Way}) where T<:Union{OpenStreetMapX.ENU,OpenStreetMapX.ECEF}
    oneway_roads = map(OpenStreetMapX.oneway,roadways)
    reverse_roads = map(OpenStreetMapX.reverseway,roadways)
    classes = OpenStreetMapX.classify_roadways(roadways)
    edges = Dict{Tuple{Int,Int},Int}()
    for i = 1:length(roadways)
        for j = 2:length(roadways[i].nodes)
            n0 = roadways[i].nodes[j-1]
            n1 = roadways[i].nodes[j]
            start = n0 * !reverse_roads[i] + n1 * reverse_roads[i]
            fin = n0 * reverse_roads[i] + n1 * !reverse_roads[i]
            edges[(start,fin)] = classes[roadways[i].id]
            oneway_roads[i] || (edges[(fin,start)] = classes[roadways[i].id])
        end
    end
    return collect(keys(edges)), collect(values(edges))
end
bartoszpankratz commented 4 years ago

Hi,

It is not used anywhere - I guess it is just a relic from the previous version of the code.

pszufe commented 4 years ago

We just should remove that parameter from the code. Lots of code has been re-engineered and in some places there are some leftovers.

bsnyh commented 4 years ago

Sorry for being late reply. Thank you so much. I hope that I can also update the code if I have a chance.

Przemysław Szufel notifications@github.com 于2019年7月30日周二 上午2:16写道:

We just should remove that parameter from the code. Lots of code has been re-engineered and in some places there are some leftovers.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pszufe/OpenStreetMapX.jl/issues/17?email_source=notifications&email_token=ALCX5SESHTL2QDM4MRQLB4LQB6B4ZA5CNFSM4IFZK2LKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3CLUZY#issuecomment-516209255, or mute the thread https://github.com/notifications/unsubscribe-auth/ALCX5SDLBIMCTWTM7SAHSCDQB6B4ZANCNFSM4IFZK2LA .