feat: ingest OSM ways as places alongside nodes - #119
Merged
Conversation
Buildings/venues mapped as OSM ways (e.g. shopping malls) were silently dropped since StreamNodes only handled node elements. Adds Way/WaySink, StreamElements (node+way scanning), and centroid-based Lat/Lng for ways, reusing the existing POI allowlist and transform pipeline. Ways require osmium add-locations-to-ways preprocessing to resolve node coordinates; unannotated ways are skipped with a warning. TransformNode is split into TransformOSMNode/TransformOSMWay wrappers over an unexported transform() to remove the stringly-typed/positional osmType argument from the public API. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Claude finished @koinsaari's task in 2m 5s —— View job Review complete
No blocking issues. This is a clean, well-scoped extension of the OSM canonical pipeline. What I checked:
🟡 Nit (non-blocking): In Notes on tooling limitations:
|
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.
Summary
Placerows, same as nodes — fixes venues like shopping malls being silently dropped (internal/sources/osm/pbf.goonly handledNodeelements before).StreamNodesreplaced withStreamElements(node + way scanning; relations still skipped). A way'sLat/Lngis the centroid of its resolvedorb.LineString— no polygon is persisted.TransformNodesplit intoTransformOSMNode/TransformOSMWay, both delegating to an unexportedtransform()— removes a stringly-typed/positionalosmTypeargument from the public API..osm.pbfto be preprocessed withosmium add-locations-to-waysso way node coordinates resolve; unannotated ways are skipped with aslog.Warn, run doesn't fail.testdata/andorra-sample.osm.pbfre-generated withosmium add-locations-to-waysso way tests have real annotated geometry; node data unaffected.Test plan
go test ./...— all unit tests passgo test -tags integration ./...— all integration tests pass (real Postgres/PostGIS via testcontainers), including a new assertion that a way-derived place (Olympia Centre,shop=mall, way54858980) upserts withosm_type='way'andparent_id IS NULLgo vet ./...andgolangci-lint run ./...clean🤖 Generated with Claude Code