pszufe / OpenStreetMapX.jl

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

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

Open bsnyh opened 4 years ago

bsnyh commented 4 years ago
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 commented 4 years ago

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