Remove off-course overshoot in osmium extract (#32)#48
Conversation
The geographic extract used `--strategy=smart -S types=multipolygon,route`, which reference-completes EVERY multipolygon/route relation that merely touches a golf_course boundary. That drags all their far-away members (bus/bike/hiking routes, large landuse/water multipolygons, public roads) into the tiles, producing the "features stretching outside the facility" overshoot reported in issue HuggeK#32. - Restrict reference-completion to golf-relevant relations by adding `-S tags=leisure=golf_course,route=golf,golf`. The smart option semantics are "(types OR complete-partial-relations) AND tags", so only (multipolygon|route) relations tagged as golf features stay complete; everything else keeps just the members inside the polygon. This preserves the route=golf multi-course schema while removing the off-course overshoot. - Add a reference-completeness step before tilemaker. osmium extract can emit a relation-member way without copying every node it references, which makes tilemaker abort ("SortedNodeStore: node <id> missing, no node"). We re-add only the missing nodes via `osmium check-refs -i` + `osmium getid` (without -r) + `osmium merge`, so no extra ways/relations (and no overshoot) return. Verified end-to-end on the Luxembourg extract: 467 off-course ways removed, all 697 golf feature ways preserved, tilemaker renders golfTiles.pmtiles without crashing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Tested this end-to-end on the full Sweden extract — the overshoot fix from #32 works, and the effect is dramatic. Findings first, then a direction note. Findings
Direction (maintainability) The The end goal should instead be cutouts of features at the facility borders: clip geometries to the Test setup and numbers
In regards to #32. 🤖 Generated with Claude Code |
…HuggeK#47) Pipeline order after the merge: tags-restricted extract -> node-reference completion -> osmium renumber (now reading extract.complete.osm.pbf) -> tilemaker --compact reading renumbered.osm.pbf. Co-authored-by: HuggeK <48095810+HuggeK@users.noreply.github.com>

Fixes #32.
Problem
The geographic extract in
run_all.shused--strategy=smart -S types=multipolygon,route. On its own,smartreference-completes every multipolygon/route relation that merely touches aleisure=golf_courseboundary, dragging all of their far-away members into the tiles — bus/bike/hiking routes, largelanduse/natural=watermultipolygons, public roads. That is the "features stretching outside the facility" overshoot visible in the PMTiles inspector.Fix
Restrict reference-completion to golf-relevant relations by adding
-S tags=leisure=golf_course,route=golf,golf. The smart option semantics are "(types OR complete-partial-relations) AND tags", so only(multipolygon|route)relations tagged as golf features stay complete; every other relation keeps just the members that actually fall inside the polygon. This preserves theroute=golfmulti-course schema while removing the off-course overshoot.Add a reference-completeness step before tilemaker.
osmium extractcan emit a relation-member way (e.g. a biglanduse=forestmultipolygon clipped by a course) without copying every node it references, which makes tilemaker abort withSortedNodeStore: node <id> missing, no node. The new step re-adds only the missing nodes viaosmium check-refs -i→osmium getid(without-r) →osmium merge, so no extra ways/relations — and therefore no overshoot — are reintroduced. It is a no-op on already-complete extracts.Verification
Built tilemaker (from the submodule) and ran the full pipeline end-to-end on the Luxembourg extract:
bash run_all.shcompletes and writesgolfTiles.pmtileswithout crashing.Note (separate build gotcha, not fixed here)
A plain
makein the tilemaker submodule auto-selects LuaJIT (Lua 5.1), butcustom-tilemaker/process.luausesmath.tointeger, which requires Lua 5.3+ (as the README states). Building withmake LUA_CMD=lua(Lua 5.3+) is required or the pipeline crashes on golf holes/tees. Worth documenting in the README/INSTALL; happy to add in a follow-up.🤖 Generated with Claude Code