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
When trying to project a spatraster, its not possible to provide any additional gdal arguments to writeRaster through ..., despite the documentation saying that ... additional arguments for writing files as in writeRaster. This is because there is already a gdal argument present in project. Could this functionality be fixed so that additional arguments can be passed through? Maybe through a named list?
## SpatRastera<- rast(ncols=40, nrows=40, xmin=-110, xmax=-90, ymin=40, ymax=60,
crs="+proj=longlat +datum=WGS84")
values(a) <-1:ncell(a)
newcrs="+proj=lcc +lat_1=48 +lat_2=33 +lon_0=-100 +datum=WGS84"b<- rast(ncols=94, nrows=124, xmin=-944881, xmax=935118, ymin=4664377, ymax=7144377, crs=newcrs)
w<- project(a, b)
# save with compression
writeRaster(w, paste0(tempfile(),".tif"),
gdal= c("COMPRESS=LZW", "PREDICTOR=3"))
# project and save to file## worksw<- project(a, b, filename= paste0(tempfile(),".tif"))
# project and save to file with gdal options## failsw<- project(a, b, filename= paste0(tempfile(),".tif"),
gdal= c("COMPRESS=LZW", "PREDICTOR=3"))
Errorinif (gdal) { :theconditionhaslength>1
The text was updated successfully, but these errors were encountered:
Thank you for reporting this. You can indeed use "wopt" but that should not be necessary (except with functions where the ellipses are used for something else, but that is not the case here). I have changed argument "gdal" to "use_gdal" to avoid this issue.
When trying to
project
a spatraster, its not possible to provide any additional gdal arguments towriteRaster
through...
, despite the documentation saying that... additional arguments for writing files as in writeRaster
. This is because there is already agdal
argument present inproject
. Could this functionality be fixed so that additional arguments can be passed through? Maybe through a named list?The text was updated successfully, but these errors were encountered: