OpenStreetMapX.jl icon indicating copy to clipboard operation
OpenStreetMapX.jl copied to clipboard

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

Open bsnyh opened this issue 5 years ago • 3 comments

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

bsnyh avatar Jul 22 '19 14:07 bsnyh

Hi,

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

bartoszpankratz avatar Jul 23 '19 05:07 bartoszpankratz

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

pszufe avatar Jul 30 '19 00:07 pszufe

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 [email protected] 于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 .

bsnyh avatar Aug 01 '19 08:08 bsnyh