createRasterLayer: Create a 'raster' spatial raster layer from a dataframe and a...

View source: R/createRasterLayer.R

createRasterLayerR Documentation

Create a raster spatial raster layer from a dataframe and a bounding box

Description

This function creates a raster spatial raster layer from a dataframe and a bounding box.

Usage

createRasterLayer(
  dfr,
  col,
  bbox,
  nx = 500,
  ny = 500,
  strCRS = get_proj4string("WGS84"),
  linear = TRUE,
  extrap = FALSE,
  duplicate = "error"
)

Arguments

dfr
  • spatial dataframe with data to rasterize

col
  • name of column in dataframe to rasterize

bbox
  • sf-style bounding box

nx
  • number of cells in y direction

ny
  • number of cells in y direction

strCRS
  • string representation of CRS in PROJ4 format (default yields long/lat in WGS84)

linear
  • flag passed to akima::interp

extrap
  • flag passed to akima::interp

duplicate
  • string passed to akima::interp

Details

Uses akima::interp(), sp::SpatialPixelsDataFrame(), and raster::raster().

Value

  • raster raster layer

Note

TODO: this function should be revised to work with sf methods, not sp methods.


wStockhausen/wtsGIS documentation built on Aug. 23, 2023, 2:31 a.m.