Speed up tif data access#1192
Conversation
Example Notebooks showing local data access with different opening parametersaccess_tif_local0.ipynb |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1192 +/- ##
=======================================
Coverage 89.55% 89.55%
=======================================
Files 280 280
Lines 21646 21653 +7
=======================================
+ Hits 19384 19391 +7
Misses 2262 2262 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
b-yogesh
left a comment
There was a problem hiding this comment.
LGTM. I did not test it but I believe the screenshots on the speedup. Should we add any tests that show that using chunks is faster than any other tile size? Also, please have a look at my comments.
| "variables. If `False`, the original data structure returned by " | ||
| "rioxarray is preserved." | ||
| ), | ||
| default=True, |
There was a problem hiding this comment.
Here it says the defaults are set to True but in the PR description it says it is set to False.
There was a problem hiding this comment.
Defaults are True to ensure backward compatibility.
| "variables. If `False`, the original data structure returned by " | ||
| "rioxarray is preserved." | ||
| ), | ||
| default=True, |
There was a problem hiding this comment.
Defaults are True to ensure backward compatibility.
| file_path: str, | ||
| overview_level: int, | ||
| tile_size: tuple[int, int] | None = None, | ||
| band_as_variable: bool = True, |
There was a problem hiding this comment.
Defaults are True to ensure backward compatibility.
| self._file_url, | ||
| overview_level=index - 1 if index > 0 else None, | ||
| tile_size=self._open_params.get("tile_size"), | ||
| band_as_variable=self._open_params.get("band_as_variable", True), |
There was a problem hiding this comment.
Here and other places too. If true is correct, change the PR description
There was a problem hiding this comment.
Defaults are True to ensure backward compatibility.
| * Added the optional argument `band_as_variable`, which allows to preserve the | ||
| original dataset structure as returned by `rioxarray`, rather than splitting | ||
| raster bands into separate data variables. This improves data access patterns and | ||
| avoids unnecessary transformations. Defaults are set to `False`. |
There was a problem hiding this comment.
This is changed to True.
chunks="auto"by default inrioxarray.open_rasteriowithinxcube.core.store.fs.impl.rasteriowhen reading GeoTIFF and JPEG2000 files.This enables efficient, storage-aware data access without forcing explicit
rechunking.
band_as_variable, which allows to preserve theoriginal dataset structure as returned by
rioxarray, rather than splittingraster bands into separate data variables. This improves data access patterns and
avoids unnecessary transformations. Defaults are set to
True.Here is an small example of a GeoTIFF access as it was implemented before:

Here is an small example of the same GeoTIFF access with

chunks="auto":Checklist:
docs/source/*CHANGES.md