Open plepe opened 2 years ago
The data you load into Overpass API needs to strictly follow the structure of planet or minutely diff files, meaning nodes, followed by ways, and finally relations, i.e. file bug.osc looks ok from a structure point of view. However, there are still some issues with timestamps and deleted nodes, which are being referenced by ways in the same file.
I have to say that the official osmium tool never worked for me to load an Overpass database with attic data. This isn't really a bug with osmium tool, it simply doesn't support this special use case.
I created an unpublished patched version, which would split the bug.osh file into multiple files based on time slices, and load one slice at a time. Unfortunately, I don't seem to have the code available anymore...
At least you should start with a "planet like" osm xml file, where all objects are present in a single version only (!). Then continue applying .osc files, which mimic minutely diffs.
Also, attic only really works on a planet scale database. I never managed to get an attic db up based on full history extracts only.
In the last two or three hours, I hacked together a little script, which would convert a .osh file to a valid .osc file for insertion into Overpass API: https://github.com/plepe/osh2osc
I haven't tested larger datasets yet, but my little tests were successful. I hope, somebody finds this useful.
One more thing i forgot: full history planet typically don't include redacted object versions. If you're unlucky and your extract depends on such redacted objects, Overpass will usually crash at some point during updates.
Also, using a geofabrik extract and applying daily updates in attic mode never worked here...
In general, you're entering uncharted territory and if some things aren't working, that's pretty much how it is.
I'm happy with a final version which does not need further updates from daily diffs (and from time to time re-import from Geofabrik extracts). That's fine.
By the way, I noticed that my script didn't really worked. Apparently, it's necessary to split the change-file into separate files and import them one-by-one. So, I updated the code to write files into a directory instead.
What software are you using?
What operating system version are you using?
What did you do exactly?
I have a .osh file which I convert to a .osc file (using osmium or osmconvert, which produced the same result) to initialize a Overpass API database with attic data. Apparently, Overpass API expects the items to appear chronologically, with ways after nodes. If I import the .osc file, Overpass API would complain about missing nodes. If I re-order the .osc file, the import is successful.
Actually, I do not know whether the bug is with Overpass API orosmium, so I created a bug report there too: osmcode/osmium-tool#241
These are the commands that I would use:
Query an object:
Result:
I modified the bug.osc and re-ordered/merged the create/modify/delete statements, see bug1.osc.
When I use this, I would get the following result:
Find all files in the following in this archive: bug.zip