I used this script to crop a raster using a polygon shapefile with python gdal.Warp, but it seems it leaves many pixels with value = 1 outside the cropline gdal.Warp(rasterOut.jp2, rasterIn.jp2, cutlineDSName=mask.shp, cropToCutline=True, dstNodata = nodata) I can select any nodata, like 0 or np.nan, but the results doesn't change Continue reading...