Skip to content

tile large rasters in R to perform functions at a lower memory cost

Notifications You must be signed in to change notification settings

IRSS-UBC/raster-tiling

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Custom Raster Tiling

Chris Mulverhill

Let's say you are running some functions on a raster or stack of rasters. This raster stack is huge and the functions will either take a long time or are very memory intensive.

You can use terra::makeTiles if you'd like to cut out the tiles and process them, but to do that you either need another shapefile or a coarser raster. How do you do that?

This is a custom function to make a shapefile of these tiles. With this shapefile, you can either:

  • Crop the raster(s) yourself and perform some function on them (example provided), then combine the outputs at the end
  • Use the shapefile as an input to terra::vrt

Either way, the code and some examples are provided. Contact Chris if you have questions about its use.

Happy tiling!

About

tile large rasters in R to perform functions at a lower memory cost

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages