Repository navigation
fix(data): give each OSM area the IRI of its own way or relation (#160) - #161
Merged
Merged
Conversation
osmium numbers areas 2*id (from a way) and 2*id+1 (from a relation), and the converters took that number as a way id, so an area could get another way's IRI and features shared IRIs, with two classes and geometries. Both converters now map areas through data/osm_ids.py, osm_scale.py keeps a closed way's line class only, and data version 2 is recorded in the meta, each engine's load.json, compare.py's extract identity and the dashboard.
Contributor
Author
|
Approved at 503bcdf. The mapping matches libosmium (an area id is twice the way id, or twice the relation id plus one), every One fix I pushed myself (503bcdf): the note on the OSM tabs was shown whatever the results were measured on, so the published version 1 results would have carried a note saying every area has its own IRI. I merge it when the checks are green. Generated by Claude Code |
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.
Requested by Mathias · project thread
Closes #160
What and why
osmium's
--add-unique-id=type_iddoes not give areas their OSM id. It numbers an areaa<n>, wherenis twice the id for a closed way, or twice the id plus one for a multipolygon relation.Both converters took
nas a way id. So an area could get the IRI of another way:a246, from way 123, becameway/246. Features then shared an IRI and had two classes and two geometries. That is how Matdata-eu/tripletrail#340's land-use side was given up at 1B triples.The changes:
bench/v2/data/osm_ids.pymapsa<n>toway/<n/2>for evennand torelation/<(n-1)/2>for oddn. Both converters use it.osm_scale.pystreams, so it can't keep a set of IRIs seen asosm_extract.pydoes. Instead, it drops the area of a closed way whose line already has a class (a track, a highway), since osmium exports such a way as both line and area.osm_ids.DATA_VERSIONis written to:osm_extract.pyalso recordsshared_iris, the features it left out because their OSM object already had a set);load.json(run_scale.sh) and of the run manifest (runs.py).compare.pytreats the same OSM file at another data version as another extract, so answers on it are counted underother_extract. The dashboard's provenance showsdata v2beside the extract, so the site keeps those runs apart. The OSM tabs carry a note on the change.run_scale.shrebuilds cached N-Triples whose meta has an older version.How it was tested
New
bench/v2/test_osm_data.py, a small osmium-style GeoJSON sequence covering:test_compare.pygets a case for another data version of one file.test_dashboard.pychecks the extract shown withdata v2.Every
bench/v2/test_*.pyandsite/test_summary.pypasses.node --check site/app.jsandbash -n run_scale.share clean.The Norway extract from the
bench-datarelease, before and after:osm_scale.py --set a, beforeosm_scale.py --set a, afterosm_extract.py, beforeosm_extract.py, aftershared_iris0)The 3 land-use areas the old
osm_extract.pydropped are back, soosm_norwayhas 275,718 land-use features instead of 275,715, and its answers may change slightly.Documentation
README.md(OSM Norway)bench/v2/suites/README.md(scale suite data)Generated by Claude Code