Available with Spatial Analyst license.
Evaluates on a cell-by-cell basis the number of times the values in a set of rasters are equal to another raster.
An arbitrary number of rasters can be specified in the input rasters list.
If a cell location contains NoData on any of the input rasters, that location will be assigned NoData on the output.
The output raster is always of integer type.
See Analysis environments and Spatial Analyst for additional details on the geoprocessing environments that apply to this tool.
EqualToFrequency (in_value_raster, in_rasters)
For each cell location in the input value raster, the number of occurrences (frequency) where a raster in the input list has an equal value is counted.
The list of rasters that will be compared against the value raster.
The output raster.
For each cell in the output raster, the value represents the number of times that the corresponding cells in the list of rasters are the same as the value raster.
EqualToFrequency example 1 (Python window)
This example evaluates the number of times a set of input rasters is equal to another raster and outputs the result as a TIFF raster.
import arcpy from arcpy import env from arcpy.sa import * env.workspace = "C:/sapyexamples/data" outETF = EqualToFrequency("cost", ["degs", "negs", "fourgrd"]) outETF.save("C:/sapyexamples/output/outetf.tif")
EqualToFrequency example 2 (stand-alone script)
This example evaluates the number of times a set of input rasters is equal to another raster and outputs the result as a Grid raster.
# Name: EqualToFrequency_Ex_02.py # Description: Evaluates the number of times a set of rasters is # equal to another raster on a cell-by-cell basis # Requirements: Spatial Analyst Extension # Import system modules import arcpy from arcpy import env from arcpy.sa import * # Set environment settings env.workspace = "C:/sapyexamples/data" # Set local variables inValueRaster = "cost" inRaster01 = "degs" inRaster02 = "negs" inRaster03 = "fourgrd" # Execute EqualToFrequency outETF = EqualToFrequency(inValueRaster, [inRaster01, inRaster02, inRaster03]) # Save the output outETF.save("C:/sapyexamples/output/outETF")
- ArcGIS Desktop Basic: Requires Spatial Analyst
- ArcGIS Desktop Standard: Requires Spatial Analyst
- ArcGIS Desktop Advanced: Requires Spatial Analyst