Description Usage Arguments Value Examples
The function crops rasters (to the shapefile boundary) using GDAL. Use only filepaths (not rasters/shapefiles loaded in R environment).
1 2 |
input_raster |
Character. Raster to be cropped (file path or Raster object). Input raster should be stored on disk for GDAL access. |
filename |
Character. Output raster path. |
shapefile_path |
Character. Filepath of a shapefile or geopackage. that is used to crop the raster. Disk path, not sp or sf object. |
large_tif |
Logical. 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 7 8 | library(gdalR)
library(Rahat)
we_eu <- milkunize("Projects/Land_use/Data/Shapefile/IMAGE_regions/Individual_regions/Western_Europe_IMAGE.shp")
dem <- milkunize("Merit_DEM_10s.tif", "m5")
# Crop dem
dem_cropped <- GDAL_crop(dem, filename = "/vol/milkun1/Mirza_Cengic/Temp/dem_we.tif", shapefile_path = we_eu)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.