You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Create a dataset - assuming the coordinates are in CRS=4326data<-data.frame(
longitude= c(11.95501, 11.95501, 11.95498, 11.95493, 11.95487, 11.95497),
latitude= c(65.67812, 65.67814, 65.67821, 65.67808, 65.67809, 65.67810),
date= as.Date(rep("2006-03-26", 6))
)
# fetch the ncdf file for a specific yearurl=paste0('NETCDF:/vsicurl/https://thredds.met.no/thredds/fileServer/senorge/seNorge_2018/Archive/seNorge2018_', year,'.nc')
# Read the netcdf file from the urlnetcdf_file=stars::read_stars(url, sub='rr', proxy=TRUE)
# Transform the dataset into an sf objectdata_st<-data %>% st_as_sf(.,
coords= c("longitude", "latitude"),
crs=4326)
# Reproject the CRS to match the CRS of the netcdfdata_st<- st_transform(data_st, crs=st_crs(netcdf_file))
data_st$rr<- st_extract(netcdf_file, data_st, time_column="date")
GDAL supports accessing to data remotely without having to download it in advance.
Should we mention it and provide some code snippets on how to do it in Python/R?
Here is an example of using GDAL virtual file system to access a remote NetCDF file without downloading it:
This snippet uses R stars library.
Such a URL works with
gdalinfo
from command line and on a wide variety of software using GDAL.Maybe Benjamin Cretois can help with that as well?
The text was updated successfully, but these errors were encountered: