exactextract
exactextract copied to clipboard
Error raised when calling a raster with multiple data variables
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!