Skip to content

Add H3 POI attribution and passthrough aggregation - #435

Open
paco-barreras wants to merge 1 commit into
mainfrom
feature/433-434-stop-passthrough-h3-attribution
Open

Add H3 POI attribution and passthrough aggregation#435
paco-barreras wants to merge 1 commit into
mainfrom
feature/433-434-stop-passthrough-h3-attribution

Conversation

@paco-barreras

Copy link
Copy Markdown
Collaborator

Why

Grid-Based stop tables can contain H3 containment areas without coordinates, but visit attribution previously required point geometry. Direct stop-table APIs also could not forward custom passthrough aggregation, forcing callers back to label APIs and external summarization.

What changed

  • Add an H3 branch to poi_map that expands all POI geometries to intersecting cells at the input resolution, computes bounded grid distances with H3ronPy's native Arrow kernel, and returns aligned POI identifiers using existing poi_map conventions.
  • Resolve repeated containment areas once, preserve missing and unmatched values, reproject POIs to WGS84, reject mixed input resolutions, and break distance ties by POI table order.
  • Expose passthrough_agg on all direct and per-user stop-table APIs and forward it only to stop summarization, including Grid-Based.
  • Preserve first-value passthrough behavior when no custom aggregator is supplied and preserve empty stop-table schemas.

Validation

  • 22 passed in test_visit_location_detection.py
  • 25 passed, 1 xfailed in test_stop_detection_utils.py
  • 11 passed in the focused direct/per-user/Grid-Based stop-detection selection
  • No VS Code diagnostics in touched Python files

Closes #433
Closes #434

This pull request includes code written with the assistance of AI. The code has not yet been reviewed by a human (remove this disclosure after human review).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support direct visit attribution from H3 containment areas to POIs Forward custom passthrough aggregations through stop-table APIs

1 participant