-
Notifications
You must be signed in to change notification settings - Fork 34
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
Error raised when calling a raster with multiple data variables #56
Comments
It works for me on the netCDF files I have with multiple variables. Do you have a file you can share so I can reproduce the error? In the not-too-distant future you should be able to call exactextract on the xarray objects directly from Python. |
Sure thing. I just downloaded a single monthly average dewpoint 2m temperature NC file from ERA5 and then created a second data var that is 2x the 'd2m' values provided, and even copied the same attributes from the 'd2m' variable over to the newly created one. Still getting the hBand when trying to run EE on either var. |
This works for me:
This is the latest master version of exactextract? What is your platform / GDAL version? |
Ok interesting. I just re-installed exact extract and tried again - still getting the error but functions fine with single variable datasets. But I am getting a warning about a pybind11 path inconsistency upon running the cmake commmand when installing exact extract. Perhaps it's related to that issue? I'm running GDAL 3.8.1.1 and my platform is a 2022 Macbook Pro running OS Ventura (13.5) and an M2 processor. How not-to-distant is this python package future? :) |
It doesn't sound related, but please feel free to open an issue with the warning you're getting.
It's committed to the repository, I just need to add a |
With #59 you can do, e.g.
this will produce a result for each of the 24 values of the time dimension in the input file:
|
Is there a way to run zone stats on a NetCDF file that has multiple data variables, while just referencing one of them in the
exactextract
call? I commonly construct NC files with multiple vars in xarray and realized that any with more than one data variable result in the following error:ERROR 10: Pointer 'hBand' is NULL in 'GDALGetRasterNoDataValue'.
Example function call:
exactextract -r "maxtemp:NETCDF:my_temp_dataset.nc[1]:maxtemp" -p gadm41_adm0.gpkg -f GID_0 -s "mean(var1)" -o output_test.csv
The above functions as long as 'maxtemp' is the only data variable in the NC file, but if I have multiple (e.g. 'maxtemp, 'mintemp'), I get the above error. I'd like to avoid reading/writing separate NC files for each individual data variable in order to run exactextract, if possible.
Thanks!
The text was updated successfully, but these errors were encountered: