Query Raquet raster files with QUADBIN spatial indexing and PostGIS-style functions
Maintainer(s):
jatorre
Installing and Loading
INSTALL raquet FROM community;
LOAD raquet;
Example
-- Load extension and query a raster file
LOAD raquet;
-- Get pixel value at a location
SELECT ST_RasterValue(
block, band_1, -73.9857, 40.7484, 'int16', 256, 'gzip'
) AS elevation
FROM read_parquet('dem.parquet')
WHERE block = quadbin_from_lonlat(-73.9857, 40.7484, 13);
About raquet
Raquet is a specification by CARTO for storing raster data in Apache Parquet format with QUADBIN spatial indexing. This extension enables DuckDB to query Raquet files directly using SQL.
Features:
- QUADBIN spatial indexing functions
- PostGIS-style raster functions (ST_RasterValue, ST_RasterSummaryStats)
- Region statistics within polygon geometries (ST_RegionStats)
- Band math operations (ST_NDVI, ST_NormalizedDifference, ST_BandMath)
- Raster clipping (ST_Clip, ST_ClipMask)
- Time-series support with CF conventions (NetCDF compatible)
- Cloud-native queries with predicate pushdown (S3/GCS)
- 10-100x faster than PostGIS Raster for analytical workloads
Links:
Added Functions
| function_name | function_type | description | comment | examples |
|---|---|---|---|---|
| QUADBIN_POLYFILL | scalar | NULL | NULL | |
| ST_Band | scalar | NULL | NULL | |
| ST_BandMath | scalar | NULL | NULL | |
| ST_Clip | scalar | NULL | NULL | |
| ST_ClipMask | scalar | NULL | NULL | |
| ST_Contains | scalar | NULL | NULL | |
| ST_GeomFromQuadbin | scalar | NULL | NULL | |
| ST_Intersects | scalar | NULL | NULL | |
| ST_NormalizedDifference | scalar | NULL | NULL | |
| ST_NormalizedDifferenceStats | scalar | NULL | NULL | |
| ST_Point | scalar | NULL | NULL | |
| ST_Raster | table_macro | NULL | NULL | |
| ST_RasterAt | table_macro | NULL | NULL | |
| ST_RasterSummaryStats | scalar | NULL | NULL | |
| ST_RasterValue | scalar | NULL | NULL | |
| ST_RegionStats | aggregate | NULL | NULL | |
| ST_X | scalar | NULL | NULL | |
| ST_Y | scalar | NULL | NULL | |
| quadbin_from_lonlat | scalar | NULL | NULL | |
| quadbin_from_tile | scalar | NULL | NULL | |
| quadbin_kring | scalar | NULL | NULL | |
| quadbin_pixel_xy | scalar | NULL | NULL | |
| quadbin_resolution | scalar | NULL | NULL | |
| quadbin_sibling | scalar | NULL | NULL | |
| quadbin_to_bbox | scalar | NULL | NULL | |
| quadbin_to_children | scalar | NULL | NULL | |
| quadbin_to_geojson | scalar | NULL | NULL | |
| quadbin_to_lonlat | scalar | NULL | NULL | |
| quadbin_to_parent | scalar | NULL | NULL | |
| quadbin_to_tile | scalar | NULL | NULL | |
| quadbin_to_wkt | scalar | NULL | NULL | |
| raquet_decode_band | scalar | NULL | NULL | |
| raquet_parse_metadata | scalar | NULL | NULL | |
| raquet_pixel | scalar | NULL | NULL | |
| raquet_pixel_interleaved | scalar | NULL | NULL | |
| read_raquet | table_macro | NULL | NULL | |
| read_raquet_at | table_macro | NULL | NULL | |
| read_raquet_metadata | table_macro | NULL | NULL |
Overloaded Functions
| function_name | function_type | description | comment | examples | |—————|—————|————-|———|———-|
Added Types
| type_name | type_size | logical_type | type_category | internal | |———–|———-:|————–|—————|———-|
Added Settings
| name | description | input_type | scope | aliases | |——|————-|————|——-|———|