Monday, 22 July 2019

Rasterize shapefile according to another big raster using gdal_rasterize


I want to rasterize a shapefile into a raster according to another raster (97284, 154208, 15001971072 (nrow, ncol, ncell)).


Since the raster is very big, I am using gdal_rasterize following the code below


    rp<-gdal_rasterize(shapefile, big raster)

However, I am getting this error


Error in as.character.default() : no method for coercing this S4 class to a vector



1) What format does the shapefile need to be in to rasterize? 2) Is there another way to rasterize a shapefile? I have tried rasterize() and it is taking very long and I have also read posts that say that gdal_rasterize is much faster for very big raster




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...