7

I received a raster that was resampled using the Save as dialog in QGIS. Now I need to describe the resampling process in a report. But I could not figure out the method used in the resampling. Is it Nearest Neighbor? Bicubic?

This question has been asked before (Resampling method used in QGIS Raster save as?) but the answer does not specify the method used.

I also tried looking at the QGis source code in GitHub, but unfortunately, I could not find where the magic takes place (I'm not a programmer)

1
  • I am also interested in the same question. What is the resampling method for changing the above layer resolution and apply "save as"? It should be possible to answer this simple question. It could be "average" because this seems to be the default for using Pyramids.
    – User
    Aug 9, 2019 at 11:55

2 Answers 2

3

If the QGIS library is using GDAL for a backend, my guess (without checking QGIS source!) is that it's using nearest because that's the default for both the gdalwarp and gdal_translate utilities.

In the future, and if possible to request that the process be controlled manually and also documented with the parameters you need.

For example, if the person warping or changing resolution could use Raster > Projection > Warp (Reproject)... or Raster > Conversion > Translate (Change Format)... where both dialogs can be edited to include -tr (change target resolution) or -r (choose resampling method).

To make the changes like in the screenshot provided, click the pencil button near the bottom right of the dialog.

changing target resolution and selecting resample method

1
  • 1
    My guess is that it's also using nearest neighbor. Just wanted to be sure. And in the future, will instruct people to use a more controlled process.
    – Daniel
    Jan 10, 2017 at 13:24
2

We can carry out a small experiment that proves that the closest value is taken when reprojecting a raster by exporting it by default.

We can create a 5x5 pixel raster, with some simple values, and georeference it to a grid of 10 degrees of longitude by 10 degrees of latitude somewhere in the world.

1

Let's reproject on the fly to some system that deforms our grid a bit, for example World Sinusoidal (EPSG 54008).

2

Let's export our raster layer to the new system, using the default values, and let's see the result ...

3

The value assumed by each new pixel is effectively the same as the closest matching pixel (we refer to the centers).


Note: the metadata AREA_OR_POINT=Area was defined by default in the original raster.

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.