longlat,GRaster-method {fasterRaster} | R Documentation |
Create longitude/latitude rasters
Description
longlat()
creates two rasters, one with cell values equal to the longitude of the cell centers, and one with cell values equal to the latitude of the cell centers.
Usage
## S4 method for signature 'GRaster'
longlat(x, degrees = TRUE)
Arguments
x |
A |
degrees |
Logical: If |
Value
A GRaster
stack.
See Also
Examples
if (grassStarted()) {
# Setup
library(terra)
# Example data
madElev <- fastData("madElev")
# Convert a SpatRaster to a GRaster
elev <- fast(madElev)
# Create longitude/latitude rasters
ll <- longlat(elev)
ll # note units of cell values!
}
[Package fasterRaster version 8.4.0.3 Index]