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

buildings_from_file: ERROR: KeyError: key 5461892572 not found #94

Closed
SimonDanisch opened this issue Apr 28, 2023 · 2 comments · Fixed by #100
Closed

buildings_from_file: ERROR: KeyError: key 5461892572 not found #94

SimonDanisch opened this issue Apr 28, 2023 · 2 comments · Fixed by #100

Comments

@SimonDanisch
Copy link

So, somehow the OSM building format has changed or something, since this error was not happening some weeks/months ago, and checking out an old version of LightOSM throws exactly the same error:

using LightOSM
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");

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 C:\Users\sdani\.julia\packages\LightOSM\Ksg88\src\buildings.jl:215
 [3] buildings_from_object
   @ C:\Users\sdani\.julia\packages\LightOSM\Ksg88\src\buildings.jl:260 [inlined]
 [4] buildings_from_file(file_path::String)
   @ LightOSM C:\Users\sdani\.julia\packages\LightOSM\Ksg88\src\buildings.jl:294
 [5] top-level scope
   @ c:\Users\sdani\SimiWorld\ProgrammerLife\GeoDev\dev\Tyler\docs\examples\UserGuide\osmmakie.jl:28

I could work around by inserting an haskey into parse_osm_buildings_dict, but I didn't understand the code well enough to make sure it's the correct fix.

@fbanning
Copy link
Contributor

We now had another user stumbling upon this error. Did anyone happen to have had a look at this in the meantime?

@mmiller-max
Copy link
Contributor

What I think has happened is that relations have been added to nodes (either a format change or some new data added). The code in parse_osm_buildings_dict assumes that everything is a way and therefore tries to lookup a node ID in a dictionary of ways. I'll push a PR but will need @captchanjack to check if we need to handle nodes in an additional way, but in the meantime if you could test the PR gets you what you expect that would be helpful please!

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

Successfully merging a pull request may close this issue.

3 participants