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

why not use m.n in the following function get_route_nodes ? #20

Open
bsnyh opened this issue Aug 9, 2019 · 1 comment
Open

why not use m.n in the following function get_route_nodes ? #20

bsnyh opened this issue Aug 9, 2019 · 1 comment

Comments

@bsnyh
Copy link

bsnyh commented Aug 9, 2019

function get_route_nodes(m::OpenStreetMapX.MapData, route_indices::Array{Int64,1})
    route_nodes = Array{Int}(undef,length(route_indices))
    v = Dict{Int,Int}(reverse.(collect(m.v)))
    for n = 1:length(route_nodes)
        route_nodes[n] = v[route_indices[n]]
    end
    return route_nodes
end

In the above function, is the variable v the same as m.n or did I miss something?

@pszufe
Copy link
Owner

pszufe commented Aug 9, 2019

Yes you are right.

Identical code is executed where a MapData object is constructed:

n = Dict(reverse.(collect(v)))

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

2 participants