Zusammenfassung
Performs an arithmetic operation between two rasters or between a raster and a scalar and returns a raster object with the operation applied.
Diskussion
For more information about how this function works, see the Arithmetic raster function.
Syntax
Arithmetic (raster1, raster2, {operation_type}, {extent_type}, {cellsize_type})
Parameter | Erläuterung | Datentyp |
raster1 | The first input raster. This can be a scalar raster where all pixels have the same value. | Raster |
raster2 | The second input raster. This can be a scalar raster where all pixels have the same value. | Raster |
operation_type | The arithmetic operation to apply between the two input rasters.
(Der Standardwert ist Plus) | String |
extent_type | The method to use to compute the extent of the output when the input rasters have different extents.
(Der Standardwert ist FirstOf) | String |
cellsize_type | The method to use to compute the cell size of the output when the input rasters have different cell sizes.
(Der Standardwert ist FirstOf) | String |
Datentyp | Erläuterung |
Raster | The output raster with the arithmetic operation applied. |
Codebeispiel
Multiplies two rasters and uses the total extent of the inputs.
import arcpy
new_raster = arcpy.ia.Arithmetic("Raster1.tif","Raster2.tif", "Multiply", "UnionOf", "FirstOf")