feat(bindings): single-tile getters (tbox + stbox)#88
Closed
estebanzimanyi wants to merge 1 commit intomainfrom
Closed
feat(bindings): single-tile getters (tbox + stbox)#88estebanzimanyi wants to merge 1 commit intomainfrom
estebanzimanyi wants to merge 1 commit intomainfrom
Conversation
…tValueTimeTile + spatial
Adds the per-input lookup form of the tile family as a counterpart to
the LIST<TBOX>/LIST<STBOX> emitters previously shipped as
valueTiles / timeTiles / valueTimeTiles / spaceTiles / etc.
Temporal (3 names, 5 overloads):
getValueTile(double, double [, double=0.0]) -> tbox
getTBoxTimeTile(timestamptz, interval
[, timestamptz='2000-01-03']) -> tbox
getValueTimeTile(double, timestamptz, double, interval
[, double=0.0, timestamptz='2000-01-03']) -> tbox
Spatial (3 names, 6 overloads):
getSpaceTile(geom, xsize) -> stbox (uniform xyz)
getSpaceTile(geom, xsize, ysize, zsize [, sorigin]) -> stbox
getStboxTimeTile(timestamptz, interval
[, timestamptz='2000-01-03']) -> stbox
getSpaceTimeTile(geom, t, xsize, ysize, zsize, interval
[, sorigin, torigin]) -> stbox
All temporal variants funnel through the MEOS internal
`tbox_get_value_time_tile`. The basetype/spantype hint to MEOS comes
from the first argument: T_FLOAT8/T_FLOATSPAN for value-bearing
variants, T_TIMESTAMPTZ/T_TSTZSPAN for the time-only getter (this
detail is what mirrors how the MobilityDB PG layer derives the basetype
from the first SQL arg in `Tbox_get_value_time_tile_common`).
Spatial variants call `stbox_get_space_tile` / `stbox_get_time_tile` /
`stbox_get_space_time_tile` directly with a default-cached
`Point(0 0 0)` GSERIALIZED used when no explicit sorigin is supplied.
Test 026_single_tile_getters.test exercises every shape (10 assertions).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 1, 2026
Member
Author
|
Superseded by the consolidated PR branch |
4 tasks
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 per-input lookup form of the tile family — given a single point in the (value, time, space) domain and a tile-grid configuration, return the one tile that contains it. These complement the previously-shipped LIST emitters (
valueTiles/timeTiles/valueTimeTiles/spaceTiles/...).getValueTiledouble, double [, double=0.0]tboxgetTBoxTimeTiletimestamptz, interval [, timestamptz='2000-01-03']tboxgetValueTimeTiledouble, timestamptz, double, interval [, double=0.0, timestamptz='2000-01-03']tboxgetSpaceTilegeom, xsize(uniform xyz) orgeom, xsize, ysize, zsize [, sorigin]stboxgetStboxTimeTiletimestamptz, interval [, timestamptz='2000-01-03']stboxgetSpaceTimeTilegeom, t, xsize, ysize, zsize, interval [, sorigin, torigin]stbox11 overloads in total.
Implementation notes
tbox_get_value_time_tile(declared inmeos_internal.h). The basetype/spantype hint mirrors how the MobilityDB PG layer derives them from the first SQL arg:T_FLOAT8/T_FLOATSPANfor value-bearing variants,T_TIMESTAMPTZ/T_TSTZSPANfor the time-only getter. This detail matters — passingT_FLOAT8for the time-only path makes MEOS raiseSpan cannot be empty.stbox_get_space_tile/stbox_get_time_tile/stbox_get_space_time_tiledirectly. Defaultsorigin = Point(0 0 0)is built once and cached.Test plan
test/sql/parity/026_single_tile_getters.test— 10 assertions covering every shape (no-origin, explicit-origin, uniform-xyz convenience).🤖 Generated with Claude Code