I'm having some problems with clipping rasters.

I started clipping my raster using extents, but I saw that the clipped raster is different from the original raster. I created a virtual raster to use as a mask layer but the tool doesn't generate the output file.

  • 1
    Hi Nadia, can you provide a picture to show what you're getting? Perhaps it's a spatial reference difference between the supplied extent and the images' spatial reference, can you confirm they are in the same reference? – Michael Stimson Sep 1 '14 at 22:11
  • It is really subtle, but I can see how the image "moves"when I activate and disactivate the layer, as if the clipped imaged was a little bit moved down – Nadia Sep 1 '14 at 22:46
  • 1
    A little resampling is common, that can make the image appear to move. If you try taking whole cells then it will remove resampling - if you use the QGIS raster converter (which is GDAL_Translate) and edit the command to include -srcwin option you will clip to whole cells, but you need to calculate in cellular coordiates - or -projwin in image coordinates. see gdal.org/gdal_translate.html – Michael Stimson Sep 1 '14 at 22:49
  • In addition to Michael's excellent response, if you have clipped your raster you may well have a different range of values. The range of values is used to set the stretch on the shading (default grey-scale) and that can make the raster appear different (the degree of difference depending on the amount by which the raster statistics in the clipped version are different to those in the original). – MappaGnosis Sep 2 '14 at 7:15
  • Thanks a lot!!! n.n Hope I can get it fixed :) Have a great day!! – Nadia Sep 2 '14 at 20:10

Your Answer

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

Browse other questions tagged or ask your own question.