3

When I cut one raster with clip raster by mask layer I get the expected result.

But when applying batch processing with the same vector file, and the same rasters, the rasters aren't clipped and the values are changed to 0 and NaN?

The rasters are landsat 5 images, and the vector has the same datum.

Edit: I've figured out this is the gdal command used when processing individually:

gdalwarp -ot Float32 -q -of GTiff -cutline "some_shape.shp" -co COMPRESS=DEFLATE -co PREDICTOR=1 -co ZLEVEL=6 -wo OPTIMIZE_SIZE=TRUE "original_raster.tif" "clipped_raster.tif"

And this one is used in batch processing:

gdalwarp -ot Byte -q -of GTiff -cutline "some_shape.shp" -co COMPRESS=NONE -wo OPTIMIZE_SIZE=TRUE "original_raster.TIF" "clipped_raster.tif"

Why the differences?

1 Answer 1

4

The answer was in the gdal command, in the batch processing menu, click on Toggle advanced mode and change Output raster type to Float32. Still don't know why the predetermined option is Byte.

1
  • Might be a bug worth reporting at hub.qgis.org.
    – AndreJ
    Commented Sep 18, 2017 at 5:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.