View source: R/initialise_raster.R
initialise_raster | R Documentation |
Create an empty or constant raster with specified attributes.
initialise_raster( x, outfile, extent, res, crs, init = NA, datatype = "FLT4S", overwrite = TRUE, return_rast = FALSE )
x |
Optional. Raster* object or a file path to template raster. If this
is provided, |
outfile |
Target raster file path. Directory will be created (recursively) if it doesn't exist. |
extent |
Either a character path to a raster file, an Extent object (or an object from which such an extent can be extracted), or a numeric vector with four elements giving xmin, xmax, ymin, ymax. |
res |
Numeric or integer vector giving the horizontal and vertical
spatial resolution of the target raster, in units of |
crs |
Target coordinate reference system as a PROJ string (character)
or an object of class CRS. If missing and |
init |
Numeric. A value assigned to all cells of the created raster. |
datatype |
Character. Data type for the created raster. See
|
overwrite |
Logical. Should |
return_rast |
Logical. Should the resulting raster be returned? |
An empty raster is created at outfile
, and the corresponding
RasterLayer
is returned if return_rast
is TRUE
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.