
Warp and resample a source pixel buffer into a destination grid (deprecated)
Source:R/warp.R
warp_resample.RdDeprecated: use warp_buffer(), which takes every kernel, integer, double
and raw data, several bands and nodata, and returns a matrix as
warp_exec() does. warp_resample() calls the rwarp crate's deprecated
warp_resample shim: integer data, one band, "near" or "bilinear".
Usage
warp_resample(
src_crs,
src_gt,
dst_crs,
dst_gt,
dst_dim,
src_pixels,
src_ncol,
src_nrow,
src_col_off,
src_row_off,
nodata = -32768L,
max_error = 0.125,
resample = "near"
)Arguments
- src_crs, src_gt
Source CRS and geotransform.
- dst_crs, dst_gt
Destination CRS and geotransform.
- dst_dim
Integer
c(ncol, nrow)of the destination window.- src_pixels
Integer vector (row-major) of source values.
- src_ncol, src_nrow
Dimensions of the source buffer.
- src_col_off, src_row_off
0-based offset of the source buffer within the full source raster.
- nodata
No-data integer. Default
-32768L.- max_error
Approx-transformer pixel error bound. Default
0.125.- resample
"near"(default) or"bilinear".
Value
Integer vector of length prod(dst_dim), row-major.
Convert to a matrix with
matrix(result, nrow = dst_dim[2], ncol = dst_dim[1], byrow = TRUE).
Details
The source buffer must be a row-major integer vector.
Use as.integer(as.vector(t(m))) to convert from an R matrix m.
See also
warp_buffer(), which replaces it.