Skip to content

IDEA: Publish raster/tensor data in additional format(s) #394

Description

@afeld

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:

  1. Icechunk
  2. Xarray
  3. Dask
  4. Parquet
  5. 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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions