Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to write many rasters for chunked DataArray? #433

Open
TomAugspurger opened this issue Nov 12, 2021 · 3 comments
Open

Option to write many rasters for chunked DataArray? #433

TomAugspurger opened this issue Nov 12, 2021 · 3 comments
Labels
dask Dask related issue. proposal Idea for a new feature.

Comments

@TomAugspurger
Copy link
Contributor

TomAugspurger commented Nov 12, 2021

Currently, .rio.to_raster will generate a single raster, even for chunked DataArrays. In the case of very large Dask Arrays, it might be more useful to instead write many rasters, perhaps one per chunk. This would better-align with, e.g. dask.DataFrame.to_csv, which writes a single CSV file per partition.

This adds some complexity to how the actual filename is determined, but we can rely on some conventions established in dask / elsewhere to come up with something sensible.

https://discourse.pangeo.io/t/generating-cogs-and-stac-items-from-dataarrays/1913 has some more background information.

This is somewhat related to #432, by providing an alternative that wouldn't need locks.

@TomAugspurger TomAugspurger added the proposal Idea for a new feature. label Nov 12, 2021
@snowman2
Copy link
Member

What about this: https://xarray.pydata.org/en/stable/generated/xarray.Dataset.to_zarr.html

GDAL 3.4 added support for Zarr.

Or, are you specifically needing GeoTIff?

@TomAugspurger
Copy link
Contributor Author

In this cases, specifically COGs for interoperability with that toolchain.

@snowman2
Copy link
Member

The xcog implementation looks pretty neat 👍.

My initial thoughts:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dask Dask related issue. proposal Idea for a new feature.
Projects
None yet
Development

No branches or pull requests

2 participants