Closed kongdd closed 9 months ago
How did you load the nc
file?
By the following command:
exactextract -r temp:NETCDF:ET_LISFLOOD.nc:Evap \
-p Selected_Elasticity_10YThre.shp \
-f name -s "mean(temp)" -o ET_LISFLOOD2.csv
Oops, I saw this in my email and thought it was referring to https://github.com/isciences/exactextractr . Currently the command-line version processes only a single band. You can specify the band manually, e.g., temp:NETCDF:ET_LISFLOOD.nc:Evap[2]
, and loop over all bands.
If you want to easily process all of the bands at once, maybe give the R package a try.
Here is a minimal example of the R usage: https://gist.github.com/dbaston/26e8b739dd2549cf1a4c9718981354d3
Thanks for your script.
So, is there any solution for exactextract to retrieve data from multiple dates from a netcdf file?
Currently you'd need to either loop through the bands or use the R package.
Got it. The program is awesome -- very fast. For python it may be a good replacement for rasterstats, which is very good too, but terrible slow.
One of my nc file has the dimension of
[nlon, nlat, ntime]
, ntime = 365. However, when using exactextract, only the data of the first date was extracted.