Description Usage Arguments Details Value Note Author(s) See Also Examples
'ResampleStack' transfers values between non matching 'RasterLayers' in terms of origin and spatial resolution.
To adjust the spatial resolution, a bilinear interpolation is applied.
1 2 3 4 | resampleStack(rasterStack, resampleSettings, decimalPlaces = 4,
outType = "mean", writeOutput = FALSE,
outputName = "resample", tmpCreate = FALSE, tmpDir = "",
outDir = "", ... )
|
rasterStack |
A |
resampleSettings |
A |
decimalPlaces |
An object of class |
outType |
An object of class |
writeOutput |
An object of class |
outputName |
An object of class |
tmpCreate |
An object of class |
tmpDir |
An object of class |
outDir |
An object of class |
... |
Further arguments passed to the function |
In addition to the function resample, 'resampleStack' provides the export of each resampled 'RasterLayer' as GeoTIFF.
If it is desired to convert the unit ('u1') of the 'RasterStack' into a different unit ('u2'), the arguments ('u1') and ('u2') (see unitConv) can be additionally passed to 'rasterStack'.
An object of class 'RasterLayer' returning the mean or sum (depending on outType) of the resampled 'RasterStack'.
File format of written ouput: GeoTIFF.
Alexander R. Groos (alexander.groos@giub.unibe.ch)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # Load the provided RasterLayer objects as exemplary
# input for the function
data(airTemperature_30m_daily, precip_10km_daily,
package = "glacierSMBM")
# Individual RasterLayer objects should be loaded or created
# using the function raster()
# Resample and interpolate a precipitation file with 10 km spatial
# resolution using the parameters of air temperature (30m)
# Additionally, convert from mm h-1 to m d-1
output <- resampleStack(stack(precip_10km_daily),
airTemperature_30m_daily,1, writeOutput = FALSE,
u1 = "mm/h", u2 = "mm/d", decimalPlaces = 5)
# Plot output
plot(precip_10km_daily, main = "precipitation (10km)",
legend.args=list(text='precipitation (m)', side=3, line=1.5))
plot(output, main = "resampled precipitation (30m)",
legend.args=list(text='precipitation (m)', side=3, line=1.5))
|
Loading required package: raster
Loading required package: sp
Loading required package: udunits2
udunits system database read
sh: 1: awk: Permission denied
sh: 1: awk: Permission denied
sh: 1: awk: Permission denied
sh: 1: awk: Permission denied
sh: 1: awk: Permission denied
sh: 1: awk: Permission denied
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.