DeloitteOptimalReality / LightOSM.jl

A Julia package for downloading and analysing geospatial data from OpenStreetMap APIs.
https://deloitteoptimalreality.github.io/LightOSM.jl/docs
Other
48 stars 13 forks source link

JSON loader looks like its broken #30

Closed mmiller-max closed 3 years ago

mmiller-max commented 3 years ago
julia> data = download_osm_network(:point, radius=0.5,
                                          point=GeoLocation(-37.8136, 144.9631),
                                          network_type=:drive,download_format=:json,
                                          save_to_file_location="melbourne_1k.json");
[ Info: Overpass server is available for download
[ Info: Downloaded osm network data from ["radius: 0.5", "point: GeoLocation\n  lat: Float64 -37.8136\n  lon: Float64 144.9631\n  alt: Float64 0.0\n"] in json format
[ Info: Saved osm network data to disk: melbourne_1k.json

julia> g = graph_from_file("melbourne_1k.json")
ERROR: MethodError: no method matching Way(::Int64, ::Vector{Any}, ::Dict{String, Any})
Closest candidates are:
  Way(::T, ::Vector{T}, ::Dict{String, Any}) where T<:Integer at /Users/mal/Documents/Contracting/DeloitteAustralia/Repos/LightOSM.jl/src/types.jl:51
Stacktrace:
 [1] parse_osm_network_dict(osm_network_dict::DataStructures.DefaultDict{Any, Any, UnionAll}, network_type::Symbol)
   @ LightOSM ~/Documents/Contracting/DeloitteAustralia/Repos/LightOSM.jl/src/parse.jl:218
 [2] init_graph_from_object
   @ ~/Documents/Contracting/DeloitteAustralia/Repos/LightOSM.jl/src/parse.jl:346 [inlined]
 [3] graph_from_object(osm_data_object::Dict{String, Any}; network_type::Symbol, weight_type::Symbol, graph_type::Symbol, precompute_dijkstra_states::Bool, largest_connected_component::Bool)
   @ LightOSM ~/Documents/Contracting/DeloitteAustralia/Repos/LightOSM.jl/src/graph.jl:30
 [4] graph_from_file(file_path::String; network_type::Symbol, weight_type::Symbol, graph_type::Symbol, precompute_dijkstra_states::Bool, largest_connected_component::Bool)
   @ LightOSM ~/Documents/Contracting/DeloitteAustralia/Repos/LightOSM.jl/src/graph.jl:84
 [5] graph_from_file(file_path::String)
   @ LightOSM ~/Documents/Contracting/DeloitteAustralia/Repos/LightOSM.jl/src/graph.jl:80
 [6] top-level scope
   @ REPL[4]:1