Repository navigation
Conversation
compute_idx_and_geometry skipped nodes it found neither in the attic nor in the current data. In a regional history extract that happens to nodes whose only version in the extract is their deletion, e.g. because they were outside the region while visible. The stored way version then had fewer coordinates than nds, and since older versions are stored as deltas from newer ones, expanding any older version through it failed with "Bad geometry for way", so [date:] queries lost the way for every earlier date. Do as compute_geometry already does for current versions: push a zero Quad_Coord for the unknown node, keeping the geometry aligned with the nds, and compute the index only from the nodes with a known position. Queries print such a node as a reference without coordinates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01736kJV9ygtU1g57EBR2Ufo
This was referenced Nov 21, 2026
|
I’m not sure if 0, 0 is really a good choice. Elsewhere there’s 200, 100 in use for invalid geometry. This needs some more thought about potential side effects. |
Owner
Author
|
Thanks, good catch. I'm going to leave it as is for the moment -- for now, I'm not expecting/intending to offer the better-imports series of commits upstream, they were just so I could bootstrap a database locally to have something to do performance analysis against. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #55; targets its branch.
Fixes #49.
Collected with the other import changes on
better-imports, which is kept apart fromall-changes.Change
compute_idx_and_geometryskipped a node it found neither in the attic nor in the current data. In a regional history extract that happens to nodes whose only version in the extract is their deletion. The stored way version then had fewer coordinates than nodes, so every older version failed to expand with "Bad geometry for way". Now, ascompute_geometryalready does for current versions, a zeroQuad_Coordis pushed for such a node, and the index is computed only from the nodes with a known position. Queries print the node as<nd ref="N"/>without coordinates. One function, a few lines.Impact
osm3s_queryis unchanged. Not re-timed.Testing
osmium getid --with-history -r; 12 way versions, 512 node versions): before,[date:"2011-01-01T00:00:00Z"];way(<id>);out geom;failed with "Bad geometry"; after, it prints the way with its bounds, and the two unknown nodes as references without coordinates.fuzz.py --db-b,--features history,users,complete --seed 2 --count 1500): 1,490 same, 3 skipped, 7 different; in all 7, the previous database printed "Bad geometry" errors for two ways and this one doesn't.Limitations
compute_geometry. Code that reads stored geometry without checking for it would see a point at the origin of the quad-tile scheme; query output doesn't.Generated by Claude Code