Approximate re-creation of a raster from a quadmesh.

qm_as_raster(x, index = NULL)

Arguments

x

'mesh3d' object

index

optional index to specify which z coordinate to use as raster values

Value

RasterLayer

Details

The raster is populated with the mean of the values at each corner, which is closest to the interpretation use to create mesh3d from rasters. This can be over ridden by setting 'index' to 1, 2, 3, or 4.

Examples

qm_as_raster(quadmesh(etopo))
#> class      : RasterLayer 
#> dimensions : 135, 540, 72900  (nrow, ncol, ncell)
#> resolution : 0.6666667, 0.6666666  (x, y)
#> extent     : -180, 180, -90, 0  (xmin, xmax, ymin, ymax)
#> crs        : +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0 
#> source     : memory
#> names      : layer 
#> values     : -6784.148, 4603.07  (min, max)
#>