3

Using QGIS

I want to clip a 100gb VRT raster (UAS) into tiles using a predefined polygon grid (polygon gpkg). I want each tile file to be named by the value contained in the "grid_square" field inside the grid gpkg.

What raster tool should I use for this?

1 Answer 1

0

Are you willing to try a solution in R ?

library(sf)
library(terra)

grid <- st_read(dsn = "polygon_grid.gpkg")
r <- rast("uas.vrt")

lapply(1:nrow(grid), function(tileIndex) {
    tile <- grid[tileIndex,]
    tileID <- tile$grid_square
    cropped <- crop(r, tile)
    cropped_name = paste0(tileID, ".tif")
    writeRaster(cropped, cropped_name)
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.