ResampleStack transfers values between non matching
RasterLayers in terms of origin and spatial resolution.
To adjust the spatial resolution, a bilinear interpolation is applied.
In addition to the function
'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 (
unitConv) can be additionally passed to
An object of class
'RasterLayer' returning the mean or sum (depending on
outType) of the resampled
File format of written ouput: GeoTIFF.
Alexander R. Groos (firstname.lastname@example.org)
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.