sa_calc: Raster Calculations with arcpy.sa

Description Usage Arguments Details Value Examples

View source: R/utils.r

Description

Perform Raster Calculations with arcpy.sa.

Usage

1
sa_calc(expressions, inrasters = list(), outrasters = list())

Arguments

expressions

A named list of raster calculation expressions to be executed in sequence. The names must be valid python object names.

inrasters

A named list of file paths to rasters to be loaded prior to performing the calculations listed in expressions. The names must be valid python object names. Raster objects will be created via arcpy.sa.Raster().

outrasters

A named list of file paths to save rasters resulting from the calculations in expressions. The names must be valid python object names. Rasters will be saved via <raster object>.save()

Details

Note that this function exposes the arcpy.sa namespace, rather than importing all functions from arcpy.sa into the global environment. Therefore, calls to arcpy.sa functions in the expressions argument must include the namespace, e.g. arcpy.sa.Log10 rather than simply Log10.

Value

No return value; raster files listed in outrasters will be saved.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run:  
input.rasters = list(inras = "path/to/input/raster")
temp.rasters = list(
  firstras = "inras > 5",
  secondras = "arcpy.sa.Power(firstras, 2)",
  thirdras = "arcpy.sa.Log10(secondras)"
)
output.rasters = list(thirdras = "path/to/output/raster")
sa_calc(temp.rasters, input.rasters, output.rasters) 

## End(Not run)

mkoohafkan/arcpyrextra documentation built on May 23, 2019, 2:02 a.m.