I am using the following command:
gdalwarp -co COMPRESS=LZW \
-ts 1024 1024 \
-cutline cutline.json \
-crop_to_cutline \
input.tif \
output.tif
the output raster has the same number of pixels as the input one, but is just cropped to a cutline.
The input raster has pixel size (from gdalinfo):
Pixel Size = (159.847049179404479,153.365855104948253)
but the output raster has:
Pixel Size = (159.820436280028900,-153.866089899794588)
Why is gdalwarp flipping the pixel size?
What can I do to have positive size everywhere?
This is with GDAL 2.1.2