fix(datacenters): report newly tagged features osmium cannot export

A still-tagged feature without exportable geometry already keeps its old
line. A newly tagged one had nowhere to go and was dropped silently; it is
now listed as skipped with a warning, so a refresh never loses a site or
hides a broken one.
This commit is contained in:
Trygve Hemminghytt committed 2026-11-03 22:58:09 +01:00
1 parent 04d626a4b1
commit 1f0a8b5f16
3 files changed
+12 -4

No files matched your search

+2 -1
View File
@@ -52,9 +52,10 @@ def line(osm_id, sequence):
'type': 'data_center', 'osm_id': osm_id}})
norway = [([(0, 0), (20, 0), (20, 80), (0, 80)], False)]
lines = [line(7, 1), line(8, 2)]
out, report = merge(lines, {}, norway, {'w7'})
out, report = merge(lines, {}, norway, {'w7', 'w12'})
assert out == [lines[0]], out
assert report['unexported'] == ['w7'] and report['removed'] == ['w8'], report
assert report['skipped'] == ['w12'] and report['added'] == [], report
`,
);
});
+2 -1
View File
@@ -29,7 +29,8 @@ reflects OSM as of the extract below, everything else the original snapshot.
- Contact tags are dropped as above; unchanged features keep their original
line, so geometry is only rewritten when tags or rings actually changed.
A feature is removed only once it is no longer tagged; one still tagged but
without an exportable geometry keeps its line and is reported as unexported.
without an exportable geometry keeps its line and is reported as unexported,
and a newly tagged one osmium cannot export is reported as skipped.
- Refresh: `python3 scripts/build-datacenters-norway.py --cache <dir>` uses
Geofabrik's current Norway extract and prints the dated name it used; record
that name, its OSM timestamp and MD5 here. Requires `osmium-tool`.