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(trajectory_quadbins(traj, 8)) AS q;
-- Step 2: sample each matching tile
SELECT raster_tile_value_quadbin(
band_data, width, height, quadbin, 'FLOAT32', nodata, true, traj)
FROM elevation_raquet
WHERE quadbin = ANY(trajectory_quadbins(traj, 8));
Return the distinct QUADBIN cells at a zoom level covered by a trajectory
trajectory_quadbins(tgeompoint,integer) → bigint[]
Returns the set of unique QUADBIN cells (deduplicated) whose Web-Mercator tile envelopes contain at least one instant of traj. The result is suitable as a WHERE-clause join key against a Raquet table. zoom must be in [0, 15].
-- Three instants spanning three tiles at zoom 3
SELECT trajectory_quadbins(
tgeompointFromText('SRID=4326;{Point(-60 45)@2024-01-01,
Point(0 45)@2024-01-02,
Point(60 45)@2024-01-03}'), 3);
-- {5202501994543054848,5203346419473186816,5203416788217364480}
-- Count of Raquet tiles a ship trajectory overlaps at zoom 8
SELECT array_length(trajectory_quadbins(trip4326, 8), 1) AS tile_count
FROM trips
ORDER BY tile_count DESC;
Sample a Raquet raster chip along a trajectory using a QUADBIN cell for georeferencing
raster_tile_value_quadbin(bytea,integer,integer,bigint,text,float8,boolean,tgeompoint) → tfloat
Evaluates a row-major single-band pixel array at each instant of traj (SRID 4326). The tile georeferencing (bounding box, pixel-to-coordinate mapping) is derived from quadbin alone via the Web-Mercator slippy-tile transform. The pixtype argument must be one of UINT8, INT16, INT32, FLOAT32, or FLOAT64. When has_nodata is true, instants whose pixel equals nodata are silently dropped. Returns NULL when no instant survives.
-- Sample elevation tiles from a Raquet Parquet table
-- for all ship trajectories
SELECT t.tripid,
raster_tile_value_quadbin(
r.band_data, r.width, r.height, r.quadbin,
'FLOAT32', r.nodata, true, t.trip4326)
FROM trips t
JOIN elevation_raquet r
ON r.quadbin = ANY(trajectory_quadbins(t.trip4326, 8));
-- Average sea-surface temperature per trajectory
SELECT t.tripid,
avgValue(raster_tile_value_quadbin(
r.band_data, 256, 256, r.quadbin,
'INT16', -9999, true, t.trip4326)) AS mean_sst
FROM trips t
JOIN sst_raquet r
ON r.quadbin = ANY(trajectory_quadbins(t.trip4326, 6));