Add static-geometry to h3indexset prefilter UDFs#131
Draft
estebanzimanyi wants to merge 1 commit into
Draft
Conversation
H3INDEXSET is a Set<H3INDEX> blob built from a static geometry at a given H3 resolution. Two new UDFs: - geoToH3IndexSet(GEOMETRY, INTEGER) returns H3INDEXSET — covers POINT, LINESTRING, POLYGON, MULTI*, and GeomCollection input. Caller passes geometry in EPSG:4326 (e.g. ST_Transform). - everIntersectsH3IndexSet_Th3Index(H3INDEXSET, TH3INDEX) returns BOOLEAN — true when the trajectory ever passes through any cell of the static set. These accelerate the trip x static cross-join queries (BerlinMOD Q4, Q7, Q11, Q12, Q15, Q17 on the bench). Q7-style intersection on BerlinMOD sf 0.005: 0.517 s without prefilter, 0.076 s with the prefilter (6.8x).
Member
Author
Reviewer's quickstart — ~2-3 minutesWhat this PR does: Add static-geometry to h3indexset prefilter UDFs. Risk: focused, single-purpose. Spot-check the source diff + matching tests; CI confirms. Cross-link: Linux arm64 CI here needs #161 for the orthogonal |
estebanzimanyi
added a commit
to estebanzimanyi/MobilityDuck
that referenced
this pull request
May 25, 2026
Bump the vcpkg meos pin dfdd2554 -> bb659c693 (MobilityDB accumulate/parity-1.4, PR MobilityDB#22) so the extension links the h3indexset static-geometry API (geo_to_h3index_set, ever_eq_anyof_h3indexset_th3index) and the extended-type C API (tcbuffer_from_mfjson, ...) — the universal unblock for the th3 prefilter UDFs (MobilityDB#131) and the extended-type ports. Adapt the binding to the bb659c693 API: - geo_as_ewkb(gs, endian, &n) -> geo_as_wkb(gs, WKB_EXTENDED, &n) (the WKB/EWKB consolidation to a variant parameter). - temptype_supports_linear -> temptype_continuous. - mult_* -> mul_* (temporal multiplication naming normalization). Reconcile 3 expected outputs to bb659c693's verified reference behaviour: - span -|- adjacency is now set-theoretic share-a-boundary (closed spans meeting at a boundary are adjacent): 1.0 -|- floatspan[1,3] (both directions) and the tint/tstzspan boundary case -> true (matches MobilityDB's own 005 test). - ln/log10/exp lifts no longer insert an interior turning point; results keep the input instant count (matches MobilityDB's 026 test). Build + full sqllogictest green (1727 assertions, 76 cases).
estebanzimanyi
added a commit
to estebanzimanyi/MobilityDuck
that referenced
this pull request
May 25, 2026
Register the H3INDEXSET type plus geoToH3IndexSet and everIntersectsH3IndexSet_Th3Index, backed by the MEOS geo_to_h3index_set / ever_eq_anyof_h3indexset_th3index API now available after the MEOS pin bump. These are the static-geometry H3 prefilter UDFs the portable BerlinMOD th3 queries (q02/q04/q05/q06/q10/q16) rely on. They register via the existing H3IndexTypes::Register* calls (no new wiring). Build + full suite green (1727). Folds open PR MobilityDB#131 (now unblocked by the MEOS pin bump).
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
Adds the two MobilityDuck UDFs that complete the h3 prefilter surface for trip × static-geometry cross-join queries (BerlinMOD Q4, Q7, Q11, Q12, Q15, Q17):
`H3INDEXSET` is a new logical type (alias on `BLOB`), storing a serialized MEOS `Set`.
Stacks on PR #129 (the th3index core).
Validation
BerlinMOD scalefactor 0.005 on a single-node DuckDB build, Q7-style intersection (every trip × every QueryPoint):
Test plan