View source: R/gdal_reproject.R
gdal_reproject | R Documentation |
This function can be used to change resolution, projection and extent of a raster.
gdal_reproject( infile, outfile, src_proj, tgt_proj, res, resampling_method = "near", tgt_extent, buffer, src_nodata, datatype = "Float32", return_rast = FALSE, overwrite = TRUE )
infile |
Character. File path to a raster file. |
outfile |
Character. Output raster file path. |
src_proj |
Character. The source file coordinate system. Only needs to
be set if you wish to reproject object and it is not specified in the
|
tgt_proj |
Character. The target coordinate system. See
|
res |
Numeric vector containing x and y resolution. e.g.
|
resampling_method |
Character. One of |
tgt_extent |
Numeric vector containing corner coordinates specified as
|
buffer |
Numeric. Add buffer (specified in units of |
src_nodata |
Integer. The nodata value for an input file. |
datatype |
A character string indicating the output data type. See the gdalwarp docs for more information. |
return_rast |
Logical. Return |
overwrite |
Logical. Should |
The resampling methods available are as follows:
near: nearest neighbour resampling (default, fastest algorithm, worst interpolation quality).
bilinear: bilinear resampling.
cubic: cubic resampling.
cubicspline: cubic spline resampling.
lanczos: Lanczos windowed sinc resampling.
average: average resampling, computes the average of all non-NODATA contributing pixels. (GDAL >= 1.10.0).
mode: mode resampling, selects the value which appears most often of all the sampled points. (GDAL >= 1.10.0).
max: maximum resampling, selects the maximum value from all non-NODATA contributing pixels. (GDAL >= 2.0.0).
min: minimum resampling, selects the minimum value from all non-NODATA contributing pixels. (GDAL >= 2.0.0).
med: median resampling, selects the median value of all non-NODATA contributing pixels. (GDAL >= 2.0.0).
q1: first quartile resampling, selects the first quartile value of all non-NODATA contributing pixels. (GDAL >= 2.0.0).
q3: third quartile resampling, selects the third quartile value of all non-NODATA contributing pixels. (GDAL >= 2.0.0).
_rast A raster file is produced on disk. Additionally, if
return_rast
is TRUE
a RasterLayer
object is returned
to R.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.