Greater Than Frequency (Spatial Analyst)
Summary
Evaluates on a cell-by-cell basis the number of times a set of rasters is greater than another raster.
Illustration
Usage
-
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.
Syntax
Parameter | Explanation | Data Type |
in_value_raster |
For each cell location in the input value raster, the number of occurrences (frequency) where a raster in the input list has a greater value is counted. | Raster Layer |
in_rasters [in_raster,...] |
The list of rasters that will be compared against the value raster. | Raster Layer |
Return Value
Name | Explanation | Data Type |
out_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 is greater than the value raster. | Raster |
Code Sample
This example evaluates the number of times a set of input GRID rasters is greater than 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" outGTF = GreaterThanFrequency("cost", ["degs", "negs", "fourgrd"]) outGTF.save("C:/sapyexamples/output/outgtf.tif")
This example evaluates the number of times a set of input GRID rasters is greater than another raster and outputs the result as a GRID raster.
# Name: GreaterThanFrequency_Ex_02.py # Description: Evaluates the number of times a set of rasters is # greater than another raster on a cell-by-cell basis # Requirements: Spatial Analyst Extension # Author: ESRI # 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" # Check out the ArcGIS Spatial Analyst extension license arcpy.CheckOutExtension("Spatial") # Execute GreaterThanFrequency outGTF = GreaterThanFrequency(inValueRaster, [inRaster01, inRaster02, inRaster03]) # Save the output outGTF.save("C:/sapyexamples/output/outgtf")