writeRast {StormR} | R Documentation |
Exporting rasters to GeoTIFF or NetCDF files
Description
The writeRast()
function exports rasters stored in SpatRaster objects to
GeoTIFF or NetCDF files.
Usage
writeRast(rast, filename = NULL, path = "./", ...)
Arguments
rast |
|
filename |
character. Output file name. Can be either a |
path |
character. Path to the directory where the file is exported to. By default |
... |
Additional arguments to be passed to
|
Value
NULL
Examples
# Creating a stormsDataset
sds <- defStormsDataset()
# Getting storm track data for tropical cyclone Pam (2015) near Vanuatu
pam <- defStormsList(sds = sds, loi = "Vanuatu", names = "PAM")
# Computing maximum sustained wind speed
pam.msw <- spatialBehaviour(pam)
# Exporting maximum sustained wind speed raster layer to a GeoTIFF file
writeRast(pam.msw, path = paste0(tempdir(), "/"))
# Computing power dissipation index for several storms near New Caledonia
sts.nc <- defStormsList(sds = sds, loi = "New Caledonia")
pdi.nc <- spatialBehaviour(sts.nc, product = "PDI")
# Exporting the power dissipation index raster layers to a NetCDF file
writeRast(pdi.nc, path = paste0(tempdir(), "/"))
[Package StormR version 0.2.1 Index]