[gdal-dev] Query regarding using gdalwarp with cutlineSQL
I am trying to clip a raster using a
polygon layer. I want to specify a where clause to select one polygon
feature from the polygon layer and subset the raster only for that one polygon feature.
I am not getting the intended results with this line of code:
ds = gdal.Warp('output.tif','input.tif', format ='GTiff', \
cutlineDSName ='parcel.shp', \
cutlineSQL ='SELECT * FROM parcel', \
cutlineWhere ='name = "first"')if ds isNone:print('Failed')else:print('Success')# prints Success but gives same result as without the cutlineSQL and cutlineWhere options
Problem is also explained in detail on StackExchange (with screenshots and sample data).
Could someone please let me know what I am missing?