-
Notifications
You must be signed in to change notification settings - Fork 85
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
can only read 32 layers from .hdf files before returning a FileNotFound
error
#544
Comments
If you have time to find the most recent version of rasterio/xarray/rioxarray where this wasn't an issue, that would be very helpful. |
A quick note as referenced in rasterio/rasterio#2490 that looking forward with gdal 3.5.1 and rasterio 1.3.0 the issue persists |
Inspired by @snowman2's comment here rasterio/rasterio#2490 (comment). I found that the target files are kept open when reading in the data in When the method was updated to load the data into memory and close the file after, the test passed:
|
We don't always want all of the data loaded into memory as there are scenarios with larger files when you only want to load in a subset of the data. If you wanted to add a |
Running into this in #606. Seems it was fine with GDAL 3.4 and the problem was introduced in GDAL 3.5. Investigation here: OSGeo/gdal#6665 |
Fix identified in GDAL. |
#607 should help as well. |
Code Sample, a copy-pastable example if possible
I've created a small repo with the necessary code to recreate the below error:
https://github.com/jamie-sgro/xarray-recreate-bug
Problem description
In Docker environments only, throws the below error. This only occurs
when trying to read .hdf files with a cumulative total of >32 layers. It always fails on the 33rd layer being read into memory regardless of the order of the files
and the contents of the files themselves. Note we use a copy of a file
for each iteration and it still fails
I believe this is an error in the intersection between xarray, rioxarray, and rasterio. See these two other issues for more details:
xr.open_rasterio
fails to locate file after being ran 3 times pydata/xarray#6715rasterio.open
"No such file found" after properly reading half of the desired files rasterio/rasterio#2490Full Error
Expected Output
The expected output is that all layers are read into memory (in this case, as an
xr.Dataset
) with no challengesEnvironment Information
python -c "import rioxarray; rioxarray.show_versions()"
python -c "import rioxarray; print(rioxarray.__version__)"
)rio --version
)rio --gdal-version
)python -c "import sys; print(sys.version.replace('\n', ' '))"
)python -c "import platform; print(platform.platform())"
)Installation method
The text was updated successfully, but these errors were encountered: