pixel_dim: Estimating metric dimensions of pixels in raster object

Description Usage Arguments Value Author(s) Examples

View source: R/pixel_dim.R

Description

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.

Usage

1
pixel_dim(raster, projected = FALSE, ...)

Arguments

raster

An object of class Raster*.

projected

Logical value indicating whether the coordinates of raster input are projected or not.

...

Further arguments passed among methods (Not yet used).

Value

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.

Author(s)

Lukas Trübenbach and Miguel Alvarez (kamapu78@gmail.com).

Examples

1
2
3
4
5
6
7
require(raster)

r <- raster(system.file("external/test.grd", package="raster"))
pixel_dim(r)

## More appropriate for projected coordinates
pixel_dim(r, projected=TRUE)

kamapu/spatialist documentation built on April 13, 2021, 5:18 a.m.