Background
Hello! I'm working with the gridded fire risk data, trying to bring it into DuckDB. (OCR, Icechunk, and Zarr are all new to me.) After a lot of trial and error, this was the simplest thing I could come up with, building off the example:
burn_prob = california_subset["bp_2011"]
ddf = burn_prob.to_dask_dataframe()
ddf.to_parquet("/tmp/burn_prob")
Then, from DuckDB:
SELECT
*,
-- making the grids
ST_MakeEnvelope(
longitude - (990 / (111320.0 * COS(RADIANS(latitude)))) / 2.0,
latitude - (990 / 111320.0) / 2.0,
longitude + (990 / (111320.0 * COS(RADIANS(latitude)))) / 2.0,
latitude + (990 / 111320.0) / 2.0
) AS geom
FROM read_parquet('/tmp/burn_prob/*.parquet');
The issue
Moving the data through:
- Icechunk
- Xarray
- Dask
- Parquet
- DuckDB
is a lot of indirection, and was challenging despite working as a Data Engineer and teaching in a Data Science program 🙃 It would be even more difficult for someone who isn't comfortable with Python.
Proposal
Publish the raster/tensor data in a common geospatial format such as GeoParquet. This would allow the data to be read directly from a much broader swath of tools (like DuckDB) without conversion.
Side note: Using square Polygons for the geometries would make my life easier, but understandable if you want to keep the file sizes smaller by sticking to Points.
Thanks!
Background
Hello! I'm working with the gridded fire risk data, trying to bring it into DuckDB. (OCR, Icechunk, and Zarr are all new to me.) After a lot of trial and error, this was the simplest thing I could come up with, building off the example:
Then, from DuckDB:
The issue
Moving the data through:
is a lot of indirection, and was challenging despite working as a Data Engineer and teaching in a Data Science program 🙃 It would be even more difficult for someone who isn't comfortable with Python.
Proposal
Publish the raster/tensor data in a common geospatial format such as GeoParquet. This would allow the data to be read directly from a much broader swath of tools (like DuckDB) without conversion.
Side note: Using square Polygons for the geometries would make my life easier, but understandable if you want to keep the file sizes smaller by sticking to Points.
Thanks!