I am trying to write .sh script command to clip raster by polygonal shapefile. Shapefile have name field with unique name of polygon feature. On the output must be rasters with name of polygons in shapefile. I'm use Linux, GDAL.
Now I use command
gdalwarp -dstnodata -9999 -cutline data/shapefile.shp data/input.tiff data/output.tiff
but in output I receive one raster.
Example on the picture:
Best Answer
Reorganise your shapefile so that one shapefile contains one feature (A,B,C in your case) only
Then use a loop like
to create each output raster.
Example of script: