View source: R/makeReference.R
makeReference | R Documentation |
makeReference
creates a raster file large enough to contain the boundary
polygon with pixels that are either aligned to the origin (default) or aligned
to pixels in another raster.
makeReference(
polyFile,
destination,
cellsize,
burn = 1,
alignTo = "origin",
reference,
nestingCellsize = cellsize
)
polyFile |
(character) path to a polygon shapefile (with |
destination |
(character) path to a .tif file where the reference grid will be created. |
cellsize |
(numeric) the desired resolution or cellsize of the the reference file. |
burn |
(integer between 0 and 255) the value to burn into cells that fall inside the polygon |
alignTo |
(character) either "origin", the default, which causes cells
to align to the origin of the projection such that cell boundaries fall on
integer multiples of the cellsize; or "reference" in which case cells will
be aligned with cells in the |
reference |
(optional, character) if |
nestingCellsize |
(numeric) This is optional and likely not needed. If
|
The new extent will be large enough to contain all the pixels within the
polygon. By default it will contain pixels aligned to the origin with pixels
edge coordinates that are even multiple of the cellsize
.
However, if alignTo
is set to "reference"
and the reference
argument is
the path to an existing raster file than the pixels will align with the pixels
in that file.
If nestingCellsize
(optional and probably rarely used) is set to a multiple
of cellsize
, than the extent will be expanded out to match the extent that
would be needed by this larger nestingCellsize
. This is useful if you are
working at multiple scales and want all scales to have the exact same extent.
One example would be to set cellsize
to 5 and nestingCellsize
to 30. That
will produce a reference raster with 5 meter pixels and an extent that will
work well with both 5 and 30 meter pixels. Setting 30 and 30 will result in
the same extent but with with 30 meter pixels.
This function is called for the side effect of creating a reference
tif at the destination
path. It does not return anything.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.