I have a shapefile with a single geometry as the following:
I also have a GeoTIFF raster that I can put behind this vector layer... I'd like to find a way of programmatically clipping this shapefile feature from my GeoTIFF file, in a way that I get a png image as a result.
The closest solution I found to this problem is this answer. This solution solves the problem using gdalwarp
with the following command line:
gdalwarp -of GTiff -cutline area_of_interest.shp -cl area_of_interest -crop_to_cutline PCE_in_gw.asc data_masked7.tiff
In my case, I only have the Shapefile and the GeoTIFF file. I didn't get what I'm supposed to put on the .asc
file and the area_of_interest
parameter in this command line sample. What extra procedures do I have to do to clip my GeoTIFF with a Shapefile while using gdalwarp
?