This function creates a geotrellis raster object (gt_RasterLayer).

gt_raster(x, ...)

# S4 method for character
gt_raster(x)

# S4 method for RasterLayer
gt_raster(x)

# S4 method for ANY
gt_raster(x, ...)

Arguments

x
input object.
...
additional arguments passed to raster if x is not character or raster.

Value

gt_RasterLayer object.

Details

This function essentially loads x into geotrellis as as raster data using the following methods:

  • character objectx is treated as a file path for raster data loaded directly into the Scala interpreter.

  • RasterLayer-class objectx is saved to disk and loaded into the Scala interpreter.

  • otherwisean attempt is made to coerce x to a RasterLayer-class object and then it is saved to disk and loaded into the Scala interpreter.

See also

raster.

Examples

## Not run: ------------------------------------ # # create gt_raster object using a raster # g1 <- gt_raster(raster(matrix(1:4, ncol=2))) # # create gt_raster object using a geotiff path # g2 <- gt_raster(system.file('extdata', 'test.tif', package='geotrellis')) # # create gt_raster object using default method # g3 <- gt_raster(matrix(1:4, ncol=2)) ## ---------------------------------------------