Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bsnyh opened this issue Jul 22, 2019 · 3 comments
Open

Comments

@bsnyh
Copy link

bsnyh commented Jul 22, 2019

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
Copy link
Collaborator

Hi,

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

@pszufe
Copy link
Owner

pszufe commented Jul 30, 2019

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
Copy link
Author

bsnyh commented Aug 1, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants