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

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

Open bsnyh opened this issue 6 years ago • 1 comments
trafficstars

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?

bsnyh avatar Aug 09 '19 17:08 bsnyh

Yes you are right.

Identical code is executed where a MapData object is constructed:

https://github.com/pszufe/OpenStreetMapX.jl/blob/919b76412883afd30a98da745219d87ac62383b0/src/parseMap.jl#L128

pszufe avatar Aug 09 '19 23:08 pszufe