Resampling
resample(raster, resolution, resampling_method='bilinear')
Resamples raster according to given resolution.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
raster |
DatasetReader
|
The raster to be resampled. |
required |
resolution |
Number
|
Target resolution i.e. cell size of the output raster. |
required |
resampling_method |
Literal[nearest, bilinear, cubic, average, gauss, max, min]
|
Resampling method. Most suitable method depends on the dataset and context. Nearest, bilinear and cubic are some common choices. This parameter defaults to bilinear. |
'bilinear'
|
Returns:
Type | Description |
---|---|
ndarray
|
The resampled raster data. |
dict
|
The updated metadata. |
Raises:
Type | Description |
---|---|
NumericValueSignException
|
Resolution is not a positive value. |
Source code in eis_toolkit/raster_processing/resampling.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|