rpygeo_save {RPyGeo}R Documentation

Save temporary raster to workspace

Description

This function saves temporary a raster as permanent raster to the workspace.

Usage

rpygeo_save(data, filename)

Arguments

data

reticulate object or full path of the ArcPy function output

filename

Filename with extension or without extension if the workspace is file geodatabase

Details

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.

Author(s)

Marc Becker

Examples


## 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)


[Package RPyGeo version 1.0.0 Index]