RasterAlgebra: Arcpy Raster Algebra

Description Usage Arguments Details See Also Examples

Description

Operators for arcpy raster algebra.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
## S3 method for class 'python.builtin.Raster'
a + b

## S3 method for class 'python.builtin.Raster'
a - b

## S3 method for class 'python.builtin.Raster'
a * b

## S3 method for class 'python.builtin.Raster'
a / b

## S3 method for class 'python.builtin.Raster'
a ^ b

## S3 method for class 'python.builtin.Raster'
a %/% b

## S3 method for class 'python.builtin.Raster'
a %% b

## S3 method for class 'python.builtin.Raster'
a < b

## S3 method for class 'python.builtin.Raster'
a > b

## S3 method for class 'python.builtin.Raster'
a <= b

## S3 method for class 'python.builtin.Raster'
a >= b

## S3 method for class 'python.builtin.Raster'
a != b

## S3 method for class 'python.builtin.Raster'
a == b

## S3 method for class 'python.builtin.Raster'
!a

## S3 method for class 'python.builtin.Raster'
a & b

## S3 method for class 'python.builtin.Raster'
a | b

## S3 method for class 'python.builtin.Raster'
xor(a, b)

## S3 method for class 'python.builtin.Raster'
bitwNot(a)

## S3 method for class 'python.builtin.Raster'
bitwAnd(a, b)

## S3 method for class 'python.builtin.Raster'
bitwOr(a, b)

## S3 method for class 'python.builtin.Raster'
bitwXor(a, b)

## S3 method for class 'python.builtin.Raster'
bitwShiftL(a, n)

## S3 method for class 'python.builtin.Raster'
bitwShiftR(a, n)

Arguments

a, b

arcpy raster objects.

n

non-negative integer.

Details

The following operators are supported:

Arithmetic Operators:

Logical Operators:

Bitwise Operators

See Also

Arithmetic, Comparison, bitwNot.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## Not run: 
use_ArcGIS()
arcpy$env$workspace = tempdir()
arcpy$env$scratchWorkspace = tempdir()
arcpy$CheckOutExtension("Spatial")

cellSize = 2
outExtent = arcpy$Extent(0, 0, 250, 250)
raster1 = arcpy$sa$CreateConstantRaster(12, "FLOAT",
  cellSize, outExtent)

raster2 = arcpy$sa$CreateConstantRaster(6, "FLOAT",
  cellSize, outExtent)

raster1 + raster2
raster1 * raster2
raster1 ^ raster2
raster1 %% raster2

raster1 > raster2
(raster1 > raster2) & (raster2 > 7)
(raster1 > raster2) | (raster2 > 7)

arcpy$CheckInExtension("Spatial")

## End(Not run)

mkoohafkan/arcpy documentation built on Aug. 9, 2020, 2:51 p.m.