pszufe / OpenStreetMapX.jl

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

get_velocities may return non-square matrix (SparseArray) #12

Closed KrainskiL closed 5 years ago

KrainskiL commented 5 years ago

I encountered size mismatch issue while trying to divide MapData.w (weights) and speeds received from get_velocities function.

mapfile = "reno_east3.osm"
datapath = "../example";
map_data = get_map_data(datapath, mapfile,use_cache=false; road_levels= Set(1:4));
max_speeds= OpenStreetMapX.get_velocities(map_data)
map_data.w./max_speeds

julia> size(map_data.w) (734, 734)

julia> size(max_speeds) (733, 734)

Get_velocities function should contain the same size constraints (length(m.v)) as passed in create_weights_matrix to ensure such computations are always possible.

bartoszpankratz commented 5 years ago

Done