Skip to content

Conversation

@brendancol
Copy link
Contributor

  • When using rioxarray.open_rasterio() with band_as_variable=True and then calling .to_array().sel(variable='band_1', drop=True), the resulting dask array has a different chunk structure than arrays created directly. The crosstab function failed because it pairs dask blocks positionally via to_delayed().ravel(), which requires aligned chunks. To fix this:
  • added documentation about float32 handling

…hen calling .to_array().sel(variable='band_1',

   drop=True), the resulting dask array has a different chunk structure than arrays created directly. The crosstab
  function failed because it pairs dask blocks positionally via to_delayed().ravel(), which requires aligned chunks.  To fix this:

  Added chunk validation for 2D inputs in crosstab, using the existing validate_arrays function (which is already
  used by zonal_stats). This function:
  1. Validates that shapes match
  2. Automatically rechunks values to match zones chunk structure when they differ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants