pixel_dim | R Documentation |
Pixel dimension in raster objects (class Raster*
) in projected space.
For non projected rasters, the bounding boxes will be reprojected to UTM coordinates for the calculation of height (latitude) and width (longitude). For projected rasters, the calculation will be directly done in the units of the respective spacial reference system.
pixel_dim(raster, ...)
## S3 method for class 'SpatRaster'
pixel_dim(raster, projected = FALSE, ...)
raster |
An object of class |
... |
Further arguments passed among methods (Not yet used). |
projected |
Logical value indicating whether the coordinates of raster input are projected or not. |
A named vector with the estimated height (latitude) and width (longitude) of pixels either in meters for non-projected rasters or in the own spacial units for projected ones.
Lukas Trübenbach and Miguel Alvarez (kamapu78@gmail.com).
## Determine resolution
r <- terra::rast(system.file("ex/elev.tif", package="terra"))
pixel_dim(r)
## More appropriate for projected coordinates
pixel_dim(r, projected = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.