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, ...)
raster
if x
is not character
or raster
.gt_RasterLayer
object.
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.
x
to a RasterLayer-class
object and then it is saved to disk and loaded into the Scala interpreter.
## 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)) ## ---------------------------------------------