2

I'm not sure I'm writing in the right place. I looked for for answer for this question and didn't find any topic related to.

PROBLEM: when I clipped a raster either by extent or mask layer it results in a raster where the first pixel starts align to the first corner I gave. As a consequence my whole raster is shifted keeping the pixel values (probably nerst neighborhood). I also tried saving as and defining map canvas extent.

SOLUTION: I figured out that they GDAL algorithm in the toolbox worked. Although it use the same command (if you pay attention on the console call at the bottom) the arguments order results in a different output. By selecting both option:

  • Crop the extent of the target dataset to the extent of the cutline
  • Keep resolution of output raster

I hope this tip is useful for someone else.

4

SOLUTION: I figured out that they GDAL algorithm in the toolbox worked. Although it use the same command (if you pay attention on the console call at the bottom) the arguments order results in a different output. By selecting both option:

Crop the extent of the target dataset to the extent of the cutline Keep resolution of output raster I hope this tip is useful for someone else.

0

The solution did not work for me. I am using Qgis 3.4. and when I selected the option "Keep resolution of output raster" I got a shifted raster. By selecting only the option "Crop the extent of the target dataset to the extent of the cutline" I got an aligned raster. I am not sure on why this happens. Hope this works for others.

  • Hi Camilo, try to select both option and double check that you define the resolution to the exact same value of the raster you want to align with. I recently sis this same process in 3.4 and it worked for me. – christian.gobel Apr 4 at 12:16
0

In my case (QGIS 3.4.5-Madeira) I receive not shifted pixels only if I set the range (xmin, xmax, ymin, ymax) which is multiple of pixel size. For example in case of 30m pixels of Landsat these values should be multiple of 30.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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