Bind the raster family: raquet tiles and trajectory sampling - #247
Merged
estebanzimanyi merged 1 commit intoAug 7, 2026
Merged
Conversation
MobilityDuck gains the MEOS raster surface, so a Web-Mercator raster tile can be sampled along a trajectory without leaving DuckDB. RAQUET is a raster tile addressed by a CARTO QUADBIN cell, surfaced as a BLOB holding the MEOS WKB serialisation of the tile — the wire form its text representation hex-encodes — so a tile round-trips through Parquet and through the VARCHAR casts. On top of it: raquet(pixels, width, height, cell, pixtype[, nodata]) build a tile raquetRead(rasterfile[, cell]) decode via GDAL quadbin / width / height / nodata / pixtype / stbox accessors eq / ne / lt / le / ge / gt / cmp / hash / hashExtended comparisons rasterTileValue(raquet, tgeompoint) sample one tile rasterTileValue(raquet[], tgeompoint) sample a tile set rasterTileValueQuadbin(pixels, …, tgeompoint) sample a pixel band trajectoryQuadbins(tgeompoint, zoom) covered cells raquetRead derives the tile identifier from the raster geotransform when no cell is given, which requires an EPSG:3857 tile-aligned raster. MEOS reads a pixel band as width x height packed values and is not told how long the buffer is, so the dimensions and the buffer length are checked before the band is passed on, as the MobilityDB raquet constructor does. test/sql/raquet.test covers the constructor and accessors, the text round trip, both sampling forms, the outside-the-tile and unknown-pixel-type paths, and the cells a trajectory covers.
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.
Adds the MEOS raster surface to MobilityDuck, so a Web-Mercator raster tile is
sampled along a trajectory without leaving DuckDB. The pinned libmeos already
carries the family (
-DALL=ONenables RASTER, with GDAL linked in), so this isbinding work only — no pin or build change.
RAQUETis a raster tile addressed by a CARTO QUADBIN cell, surfaced as a BLOBholding the MEOS WKB serialisation of the tile — the wire form its text
representation hex-encodes — so a tile round-trips through Parquet and through
the VARCHAR casts.
raquet(pixels, width, height, cell, pixtype[, nodata])raquetRead(rasterfile[, cell])quadbin/width/height/nodata/pixtype/stboxeq/ne/lt/le/ge/gt/cmp/hash/hashExtendedrasterTileValue(raquet, tgeompoint)tfloatrasterTileValue(raquet[], tgeompoint)rasterTileValueQuadbin(pixels, …, tgeompoint)trajectoryQuadbins(tgeompoint, zoom)LIST(QUADBIN)raquetReadderives the tile identifier from the raster geotransform when nocell is given, which requires an EPSG:3857 tile-aligned raster.
MEOS reads a pixel band as
width * heightpacked values and is not told howlong the buffer is, so the binding checks the dimensions and the buffer length
before passing the band on — the same check the MobilityDB
raquetconstructorperforms.
test/sql/raquet.testcovers the constructor and accessors, the text round trip,both sampling forms, the outside-the-tile and unknown-pixel-type paths, and the
cells a trajectory covers.
Full suite green on this commit: 1777 assertions in 76 test cases.