Read GeoTIFF rasters as (cell_id, value) via GDAL
Maintainer(s):
babaknaimi
Installing and Loading
INSTALL geotiff FROM community;
LOAD geotiff;
Example
-- one band -> (cell_id, value)
INSTALL geotiff FROM community;
LOAD geotiff;
SELECT * FROM read_geotiff('cea.tif', band := 1) LIMIT 5;
-- multiple bands -> (cell_id, band1, band2, ...)
SELECT * FROM read_geotiff('cea.tif', bands := [1,2,3]) LIMIT 5;
About geotiff
The geotiff extension streams GeoTIFF rasters using GDAL and exposes them as DuckDB table functions. For a single band it returns (cell_id BIGINT, value DOUBLE). If you pass multiple bands (e.g., bands := [1,2,3]) it returns a wide schema: (cell_id, band1, band2, …). This is optimized for fast CTAS/UPDATE patterns when building “wide” raster tables inside DuckDB.
Tip: for best throughput, use CTAS for the first layer and a single UPDATE … FROM read_geotiff(…) per additional layer.
Added Functions
function_name | function_type | description | comment | examples |
---|---|---|---|---|
read_geotiff | table | NULL | NULL |