[GIS] QGIS clipper problem when mask used

clipqgisraster

I have encountered a problem with the raster>extraction>clipper function in QGIS when a mask layer is used.

In the image below the diagram on the left shows part of the original raster.

The diagram in the middle shows the original with one of the red areas overlain by a polygon.

The diagram on the right shows the raster created by the clipper function using a mask.

Notice that the pixels in the clipped raster (on the right) are not in their correct location – offset downwards.

There seems to be an offset across all of the output file. The offset is approx 130 m.
Does anyone have any ideas as to why this happens? It does not happen when the extent option is used instead of mask.

I am using QGIS 2.8.1 (same happens in a previous version – 2.4). The mask layer and raster layer are in the same CRS.

enter image description here

Best Answer

Note that clipper tool (from raster menu) distort your output, or may distort it by changing cell size. My suggestion is to use the clipper under gdal tools from the toolbox.

There define -tr resx, resy in the additional parameters window; where both resx & resy > 0. Those stand for the input raster resolution, and forces the output to keep it. You can get the resolution from the properties>metadata of your input raster. Note that it will be written like this: 30.0, -30.0; thus modify it to be 30.0, 30.0.

The image below sum it up with an example:

Example

Related Question