Resample Raster
The same raster on a grid with a different cell size, in the same CRS.
Pitfall. Nearest neighbour on continuous data keeps one cell's value per new cell; average gives the mean of the cells it covers.
Pitfall. Interpolating categorical data (land cover codes) with bilinear or cubic makes codes that do not exist.
| Also called | Resample, change cell size, coarsen, aggregate cells, resize raster |
|---|---|
| Group | raster/projection |
| Checks | raster.resampling, raster.nodata |
| Pitfalls | 2 listed above |
| Columbus tool | Not stated |
| Notes | Not stated |
| Status | active |
| Broader | Not stated |
| Narrower | Not stated |
| Related |
Parameters
| Name | Type | Required | Default | Values | Note |
|---|---|---|---|---|---|
resolution | number | yes | Not stated | Not stated | New cell size, in the raster's CRS units. |
resampling | enum | no | nearest | nearest, bilinear, cubic, average, mode | nearest or mode for categories; average to coarsen continuous data. |
Inputs and outputs
| Direction | Name | Type | Geometry | Note |
|---|---|---|---|---|
| Input | raster | raster | Not stated | Not stated |
| Output | output | raster | Not stated | Not stated |
In each engine
| Engine | Tool | Parameters | Differences |
|---|---|---|---|
gdal | gdal raster reproject |
|
|
gdal | gdal raster resize |
| None noted |
grass | r.resamp.stats |
|
|
grass | r.resample |
| None noted |
postgis-raster | st_resample |
| None noted |
qgis | gdal:warpreproject |
|
|
terra | terra::aggregate |
|
|
terra | terra::resample |
| None noted |
whiteboxtools | Resample |
|
|
xarray-spatial | xrspatial.resample |
|
|