Closed mdsumner closed 7 years ago
Thanks; I updated stuff and now seem to have this working:
library(stars)
st_gdalinfo("avhrr-only-v2.19810901.nc")
st_get_subdatasets("avhrr-only-v2.19810901.nc")
st_gdalinfo("NETCDF:avhrr-only-v2.19810901.nc:anom")
# gdalwarp -t_srs '+proj=utm +zone=11 +datum=WGS84' -overwrite NETCDF:avhrr-only-v2.19810901.nc:anom utm11.tif
st_gdalwarp("NETCDF:avhrr-only-v2.19810901.nc:anom", "utm11.tif")
st_gdalwarp("NETCDF:avhrr-only-v2.19810901.nc:anom", "utm11.tif", c("-t_srs", "+proj=utm +zone=11 +datum=WGS84"))
st_gdalrasterize("nc.gpkg", "nc.tif") # where nc.tif was generated by raster
Output:
Looks good, cheers
Example files here: ftp://eclipse.ncdc.noaa.gov/pub/OI-daily-v2/NetCDF/1981/AVHRR/
gdalwarp will crash if given a file name, rather than a subdataset path - I can't get a useable example with an sds string yet but sds and gdalinfo all good.