Description Usage Arguments Details Value Author(s)
View source: R/ascGridResample.r
This function is useful for generating a set of precisely matching ASCII Grid raster files, for input to software such as MaxEnt. The function takes an input raster to adjust, a template raster (which must be an ASCII Grid .asc file), and a filename for output, and crops, resamples and aligns the input raster to exactly match the template.
1 | ascGridResample(x, template, filename = "")
|
x |
The input raster to be cropped. Either a filename, or a RasterLayer object. |
template |
The template raster. Either a filename or a RasterLayer object. Must be an ASCII Grid (.asc) file. |
filename |
The filename the output raster will be written to. |
The standard crop/extent functions in the raster package seem to have issues with coordinate precision, so software such as MaxEnt often complains of projection errors even if the number of cells in the raster input files are the same. In order to overcome this, the function manually copies the header data from the template file to the output file. All rasters should be in WGS84 projection.
The function writes the output ASCII Grid raster to disk, and returns the filename.
Grant Williamson
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.