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

Bug: key "node" not found when running example code. #43

Closed
RomeoVAirbus opened this issue Jul 19, 2023 · 3 comments
Closed

Bug: key "node" not found when running example code. #43

RomeoVAirbus opened this issue Jul 19, 2023 · 3 comments

Comments

@RomeoVAirbus
Copy link

Summary

I'm running the example code from the Readme file.
However, in the example downloading and displaying buildings, I am running into an error:

area = (
    minlat = 51.5015, minlon = -0.0921, # bottom left corner
    maxlat = 51.5154, maxlon = -0.0662 # top right corner
)
# download OpenStreetMap buildings data
download_osm_buildings(:bbox;
    area...,
    metadata = true,
    download_format = :osm,
    save_to_file_location = "london_buildings.osm",
);
# load as Buildings Dict
buildings = buildings_from_file("london_buildings.osm");

produces

ERROR: KeyError: key 5461892572 not found
Stacktrace:
 [1] getindex(h::Dict{Int64, Dict{String, Any}}, key::Int64)
   @ Base ./dict.jl:484
 [2] parse_osm_buildings_dict(osm_buildings_dict::Dict{String, Any})
   @ LightOSM ~/.julia/packages/LightOSM/Lf5Q0/src/buildings.jl:215
 [3] buildings_from_object
   @ ~/.julia/packages/LightOSM/Lf5Q0/src/buildings.jl:260 [inlined]
 [4] buildings_from_file(file_path::String)
   @ LightOSM ~/.julia/packages/LightOSM/Lf5Q0/src/buildings.jl:294
 [5] top-level scope
   @ REPL[21]:2

Any insights are appreciated!

Package versions:

julia> Pkg.status.(["LightOSM", "OSMMakie"])
Project OSM_test v0.1.0
Status `~/Documents/julia_playground/OSM_test/Project.toml`
  [d1922b25] LightOSM v0.2.11
Project OSM_test v0.1.0
Status `~/Documents/julia_playground/OSM_test/Project.toml`
  [76b6901f] OSMMakie v0.0.7
@fbanning
Copy link
Member

Hey @RomeoVAirbus , happy to read that the package is used by someone. :)

Last time I successfully ran the example code was with OSMMakie v0.0.7 and LightOSM v0.2.10.
I can now reproduce the bug you mentioned when just running the code snippet you posted above. I get the same node id in the error message.

The stacktrace you posted tells us that the issue comes from LightOSM code (specifically from the parse_osm_buildings_dict function) and OSMMakie doesn't occur in the stack at all. So I would suggest that you open an issue on the LightOSM repository (https://github.com/DeloitteOptimalReality/LightOSM.jl/issues) and ask for help over there.

Did you try reproducing the error with another bbox area?

@fbanning
Copy link
Member

I've just run it with a different set of buildings from another area and it works fine.

My best guess would be that there is some node(s) missing in the buildings data downloaded from Overpass for the London area. This could either be due to (i) actual datapoints missing in the OSM database, (ii) the Overpass API failing to deliver some pieces, (iii) our chosen bbox area cutting off some building parts, or (iv) something completely different. (Maybe LightOSM can handle such a case more gracefully somehow? I don't know.)

@fbanning
Copy link
Member

fbanning commented Jul 20, 2023

There is already an issue related to this back from 28.04.: DeloitteOptimalReality/LightOSM.jl#94

Makes more sense to discuss further steps for fixing building related parsing over there, so I'll go ahead and close this issue one here. :)

@fbanning fbanning closed this as not planned Won't fix, can't repro, duplicate, stale Jul 20, 2023
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