feat(parity): th3index — full H3 cell index API#193
Open
estebanzimanyi wants to merge 2 commits into
Open
Conversation
45df2ad to
2067f2a
Compare
961b2c7 to
8181399
Compare
2067f2a to
74ea89f
Compare
504e1ba to
dee2e01
Compare
74ea89f to
e12394e
Compare
dee2e01 to
37107d1
Compare
e12394e to
8d61366
Compare
3ec3ee9 to
ade75e5
Compare
Wraps Uber's H3 discrete global grid as MobilityDuck SQL types:
- `H3INDEX` — 64-bit cell id (BIGINT alias).
- `TH3INDEX` — Temporal* of H3 cells (BLOB alias); all four
subtypes (instant / discrete sequence / step sequence / linear
sequence / sequence set).
- Inout: text parse / format, asBinary/asEWKB/asHexWKB/asMFJSON,
fromBinary / fromHexWKB / fromMFJSON.
- Constructors: H3 cell from lat/lng+res, tinstant/tsequence/
tsequenceset constructors.
- Accessors: subtype/interp/memSize/numInstants/numSequences/
startInstant/endInstant/start{Timestamp,Value}/end{Value}/
values/valueAtTimestamp.
- Casts: th3index → tgeompoint / tgeogpoint (each with res),
th3index → tbigint (deferred; tbigint not yet exposed).
- H3 metric/topology surface: cell area / edge length / unit
string dispatch, cell→parent / center-child / child-pos / vertex,
hierarchy, neighbors, geo→cell sets (static geometry → H3 cell
set), every*/always* comparison predicates, tEq/tNe/tDistance.
- Bump MEOS port pin to `feat/th3index-complete` tip (`beddae670`
upstream) and enable `-DH3=ON`.
- vcpkg.json: add `h3` as a top-level dependency.
- CMakeLists.txt: `find_package(h3 CONFIG)` plus explicit
`find_path(h3api.h)` probe — vcpkg's h3 imported target carries
`include/` only; MEOS source uses `#include <h3api.h>` which
lives at `include/h3/`, so we publish that subdir as an include
directory.
The MEOS source at `beddae670` has four standalone-build gaps
visible only with `-DH3=ON`; vcpkg port applies these workarounds
until they land upstream:
1. `meos/include/h3/th3index_internal.h` unconditionally
`#include <fmgr.h>` (PG-only). Guarded with `#if !MEOS`,
mirroring the same idiom in `meos/include/temporal/temporal.h`.
2. `meos/CMakeLists.txt` builds the `h3` OBJECT library but the
`PROJECT_OBJECTS` list — fed to `add_library(meos ...)` —
silently omits `h3`. Without this, libmeos shipped with zero
H3 symbols even when `H3=ON`.
3. `meos/CMakeLists.txt` install rules carry every other module
header (`meos_npoint.h` / `meos_pose.h` / `meos_rgeo.h` /
`meos_cbuffer.h`) but no `install()` for `meos_h3.h`.
4. `meos/src/h3/{h3_geo,th3index_latlng,th3index_metrics}.c` call
`ensure_srid_is_latlong()` (declared in
`meos/include/geo/tgeo_spatialfuncs.h`) without including that
header → implicit-declaration error under `MEOS=1`.
Also: `H3_LIBRARY` and `H3_INCLUDE_DIR` are now passed explicitly
to the MEOS configure (resolving from `${CURRENT_INSTALLED_DIR}/
lib` and `${CURRENT_INSTALLED_DIR}/include/h3`), bypassing MEOS's
own `find_library(NAMES h3)` which does not consult vcpkg's
toolchain on every triplet (notably `arm64-linux-release`).
- Local `h3index_in` / `h3index_out` definitions (in `extern "C"`
in `src/h3/th3index.cpp`) since MEOS declares these in
`meos_h3.h` but does not provide a standalone-build definition;
the wrappers route through h3's own `stringToH3` / `h3ToString`.
- `th3index<->tbigint` cast registrations are deferred until
MobilityDuck exposes the `tbigint` base type (a separate
follow-up).
Squash of 61 iteration commits on `feat/parity-th3index`; full
history preserved on `backup/parity-th3index-orig`.
The wasm32-emscripten toolchain ships clang-tidy, so h3's ENABLE_LINTING pass (default ON when clang-tidy is on PATH) runs during the dependency build and aborts it: h3 4.3.0's own source trips its WarningsAsErrors .clang-tidy config (readability-braces-around-statements, bugprone-narrowing-conversions) and that config carries a stale AnalyzeTemporaryDtors key newer clang-tidy rejects. An h3 overlay port pins -DENABLE_LINTING=OFF so the dependency builds on every triplet.
3e8da05 to
e5d0464
Compare
ade75e5 to
72b53b2
Compare
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.
Add the th3index temporal H3 cell-index family on the pinned MEOS H3 surface: the H3INDEX scalar cell type with text I/O, the TH3INDEX temporal type, casts to tgeompoint / tgeogpoint, and the cell-index scalar surface (resolution, validity, parent/child, boundary, neighbors, grid distance). The MEOS port builds with H3 enabled and links the vcpkg h3 library; smoke coverage exercises the H3INDEX text round-trip.