Description Usage Arguments Details Value Examples
This function is a slight modification of stars::st_warp for resampling stars and RasterLayer objects.
1 2 | pvts_resample(src, dest, crs, method = "near",
no_data_value = NA_real_, use_gdal = TRUE, RasterLayer = TRUE)
|
src |
object of class stars with source raster. |
dest |
object of class stars with target raster geometry. |
crs |
coordinate reference system for destination grid, only used when dest is missing. |
method |
character; see details for options; methods other than near only work when use_gdal=TRUE. |
no_data_value |
value used by gdalwarp for no_data (NA) when writing to temporaray file. |
use_gdal |
logical; if TRUE, use gdalwarp, through sf::gdal_utils |
RasterLayer |
logical; if |
method should be one of near, bilinear, cubic, cubicspline, lanczos, average, mode, max, min, med, q1 or q3; see https://github.com/r-spatial/stars/issues/109
A stars or RasterLayer object
1 2 3 4 5 6 7 8 9 | library(raster)
library(stars)
x <- pvts_datasets$mosaic[1]
new_x1 <- st_warp(x,cellsize = 15,crs = st_crs(x)) %>% as('Raster')
names(new_x1) <- 'st_warp'
new_x2 <- pvts_resample(x,new_x1)
names(new_x2) <- 'pvts_resample'
plot(stack(new_x1,new_x2))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.