[R-sig-Geo] Cropping Large RasterStack

Bede-Fazekas Ákos b|@|ev||@t @end|ng |rom gm@||@com
Thu Jul 15 10:14:45 CEST 2021


Hello Jesús,
also you can try terra::crop(), it might be faster and/or more 
memory-efficient.
Have a nice week,
Ákos
---
Ákos Bede-Fazekas
Centre for Ecological Research, Hungary

2021.07.15. 10:04 keltezéssel, Khan, Saeed Akhtar írta:
> Hi Rojo,
>
> I think you should crop individual rasters through a loop and stack the results at the end.
>
> Best,
> Saeed
>
> -----Original Message-----
> From: R-sig-Geo <r-sig-geo-bounces using r-project.org> On Behalf Of Jesús Rojo
> Sent: Thursday, July 15, 2021 9:55 AM
> To: r-sig-geo using r-project.org
> Subject: [R-sig-Geo] Cropping Large RasterStack
>
> Hello everyone
> I have a Large RasterStack (8501485725 elements, 336.8 Mb) compounded by 23750 raster layers (0.1 degree of resolution) I would like to do a crop based on an extent
>
> 'tmax <- crop(tmax, extent(0, 20, 40, 55))’
>
> It seems to be very time-consuming, and even it seems that my pc is not able to crop after a long time Do you know another efficient way to do this task without parallelizing?
> I think that I did this task with large stacks in the past with ‘crop’ and it run well, but now I do not know if it is possible Thanks for your help Kind regards
>
> Jesús Rojo
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo



More information about the R-sig-Geo mailing list