GISRRS and Photogrammetry

Tiling of a Geospatial raster in R

It often happens that we want to process some raster data faster or simply split it up. For this we need a tool for tiling rasters. Of course we can write such a tool ourselves, but why should we do that, because in the rich repository of R there is surely already such a tool 🙂 With the help of this task, we will have the meteo library and the tiling function at our disposal. This function allows us to create tiles of a certain size and with a buffer. Additionally, the created tiles can be saved directly to a specified folder. You will see how to do this in the new video:

Code from the video below:

install.packages("meteo")
library("meteo")
library(raster)

r <- raster("D:/GIS_in_R/B08.tif")
plot(r,col = grey.colors(255))
r

t <- tiling(r, tilesize = 10000)
t
t<- tiling(r,tilesize = 1000,overlapping = 0)
plot(t[[1]],col=grey.colors(255))
t <- tiling(r,tilesize = 10000,overlapping = 0,asfiles = T,
            tilename = "sent_tile_",tiles_folder = "d:/GIS_in_R/sent_tiles/")
list.files("d:/GIS_in_R/sent_tiles/")

Leave a Reply

Your email address will not be published. Required fields are marked *