This function saves temporary a raster as permanent raster to the workspace.
Filename with extension or without extension if the workspace is file geodatabase
Some ArcPy functions have no parameter to specify an output raster. Instead they return a raster object and a temporary raster is saved to the scratch workspace. This functions writes the temporary raster as a permanent raster to the workspace.
How the file is written depends on the workspace and scratch workspace environment settings.
Workspace and scratch workspace are directories: Raster is loaded with the
raster package and is written to workspace directory. The file format is inferred from the file extension in the
Workspace and scratch workspace are file geodatabases: Raster is copied to workspace file geodatabase. No file extension necessary for the
Workspace is file geodatabase and scratch workspace is directory: Raster is copied to workspace file geodatabase. No file extension necessary for the
Workspace is directory and scratch workspace is file geodatabase: Raster is exported to workspace directory. The
filename parameter is ignored due to restrictions in
arcpy.RasterToOtherFormat_conversion function. If the automatically generated filename already exists, a number is appended to the end of the filename.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
## Not run: # Load packages library(RPyGeo) library(RQGIS) library(magrittr) # Get data data(dem, package = "RQGIS") # Load the ArcPy module and build environment arcpy <- arcpy_build_env(overwrite = TRUE, workspace = tempdir()) # Write raster to workspace directory writeRaster(dem, file.path(tempdir(), "dem.tif"), format = "GTiff") # Calculate temporary aspect file and save to workspace arcpy$sa$Aspect(in_raster = "dem.tif") %>% rpygeo_save("aspect.tif") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.