ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Greater Than Frequency

Available with Spatial Analyst license.

  • Summary
  • Illustration
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Evaluates on a cell-by-cell basis the number of times a set of rasters is greater than another raster.

Illustration

Greater Than Frequency illustration
OutRas = GreaterThanFrequency(ValRas, [InRas1, InRas2, InRas3])

Usage

  • An arbitrary number of rasters can be specified in the input rasters list.

  • When a multiband raster is specified for the Input value raster (in_value_raster in Python), only the first band will be used. To process a different band, specify the specific band to use.

  • When a multiband raster is specified as one of the Input rasters (in_rasters in Python), all the bands will be used.

    To process a selection of bands from a multiband raster, you can first create a new raster dataset composed of those particular bands with the Composite Bands tool, and use the result in the list of the Input rasters (in_rasters in Python).

  • 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.

Syntax

GreaterThanFrequency(in_value_raster, in_rasters)
ParameterExplanationData 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

NameExplanationData 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

GreaterThanFrequency example 1 (Python window)

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")
GreaterThanFrequency example 2 (stand-alone script)

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

# 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")

Environments

  • Auto Commit
  • Cell Size
  • Cell Size Projection Method
  • Compression
  • Current Workspace
  • Extent
  • Geographic Transformations
  • Mask
  • Output CONFIG Keyword
  • Output Coordinate System
  • Scratch Workspace
  • Snap Raster
  • Tile Size

Licensing information

  • Basic: Requires Spatial Analyst
  • Standard: Requires Spatial Analyst
  • Advanced: Requires Spatial Analyst

Related topics

  • An overview of the Local toolset
  • Finding the number of occurrences from an input list meeting a specified criterion
  • Equal To Frequency
  • Less Than Frequency

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2019 Esri. | Privacy | Legal