Raquet / QUADBIN Sampling

Raquet is a cloud-native raster format that stores raster tiles as rows in an Apache Parquet file. Each row holds the pixel bytes for one Web-Mercator tile together with its QUADBIN cell identifier, a 64-bit integer that encodes the tile's zoom level and Morton-interleaved x/y coordinates. No separate spatial metadata is required: the bounding box and pixel-to-coordinate mapping are fully determined by the QUADBIN value.

The typical query pattern joins a trajectory against a Raquet table in two steps:

-- Step 1: identify which tiles the trajectory overlaps
SELECT DISTINCT q FROM unnest(quadbins(traj, 8)) AS q;
-- Step 2: sample each matching tile
SELECT raster_tileValueQuadbin(traj, band_data, width, height, quadbin, 'float32', nodata,
  true) FROM elevation_raquet WHERE quadbin = ANY(quadbins(traj, 8));