Description Usage Arguments Value Examples
View source: R/GDAL_resample.R
Function does a system call to run gdal functions (works on unix systems where gdal can be called from terminal). Use only file path, function will not work with raster objects loaded in R environment.
1 2 | GDAL_resample(infile, outfile, target_resolution, method,
large_tif = FALSE, return_raster = FALSE)
|
infile |
Raster to be cropped (file path or Raster object). Input raster should be stored on disk for GDAL access. |
outfile |
Path and filename of the mosaicked output (format "E:/Folder/file.tif"). |
target_resolution |
New resolution of raster. |
method |
Resampling method. One in c("near", "bilinear", "cubic", "cubicspline", "lanczos", "average", "mode", "max", "min", "med", "q1", "q3"). |
large_tif |
Use |
return_raster |
Logical. The function stores the raster in the |
Raster object. Only if return_raster = TRUE
. Otherwise, the function side-effect is to save the file locally.
1 2 3 4 5 6 | lc_info <- "/vol/milkun1/Mirza_Cengic/Data_RAW/ESA_CCI/TIFF/YearByYear/ESACCI-LC-L4-LCCS-Map-300m-P1Y-2002-v2.0.7.tif"
out <- "/vol/milkun1/Mirza_Cengic/Projects/Land_use/Data/Predictors/Resampled/Soil_GDAL/Soil_AWCh.tif"
awch <- "/vol/milkun1/Mirza_Cengic/Projects/Land_use/Data/Predictors/Original/Soil/Soil_AWCh.tif"
res_lc <- rgdal::GDALinfo(lc_info)["res.x"]
GDAL_resample(awch, outfile = out,
target_resolution = res_lc, method = "average", large_tif = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.