ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

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
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Filter

Available with Spatial Analyst license.

  • Summary
  • Usage
  • Syntax
  • Code Sample
  • Environments
  • Licensing Information

Summary

Performs either a smoothing (Low pass) or edge-enhancing (High pass) filter on a raster.

Learn more about how Filter works

Usage

  • The LOW filter option is an averaging (smoothing) filter. The HIGH filter option is an edge-enhancement filter.

  • Input NoData cells may receive a value in the output if the Ignore NoData in calculations option is checked, provided at least one cell within the filter neighborhood has a valid value.

  • You can use the Focal Statistics tool to create custom filters to your specification.

  • See Analysis environments and Spatial Analyst for additional details on the geoprocessing environments that apply to this tool.

Syntax

Filter (in_raster, {filter_type}, {ignore_nodata})
ParameterExplanationData Type
in_raster

The input raster on which to perform the filter operation.

Raster Layer
filter_type
(Optional)

The type of filter operation to perform.

  • LOW — Traverses a low pass 3-by-3 filter over the raster. This option smooths the entire input raster and reduces the significance of anomalous cells.This is the default.
  • HIGH — Traverses a high pass 3-by-3 filter over the raster. This option enhances the edges of subdued features in a raster.
String
ignore_nodata
(Optional)

Denotes whether NoData values are ignored by the filter calculation.

  • DATA — If a NoData value exists within the filter, the NoData value will be ignored. Only cells within the filter that have data values will be used in determining the output.
  • NODATA — If a NoData value exists within the filter, the output for the processing cell will be NoData. With this option, the presence of a NoData value implies that there is insufficient information to determine the statistic value for the neighborhood.
Boolean

Return Value

NameExplanationData Type
out_raster

The output filtered raster.

The output is always floating point.

Raster

Code Sample

Filter example 1 (Python window)

This example applies a high-pass filter to the input raster.

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
filterOut =  Filter("elevation", "HIGH", "DATA") 
filterOut.save("C:/sapyexamples/output/filtered")
Filter example 2 (stand-alone script)

This example applies a low-pass filter to the input raster.

# Name: Filter_Ex_02.py
# Description: Performs a preset focal filter on a raster. 
# 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
inRaster = "elevation" 

# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")

# Execute Filter
filterOut =  Filter(inRaster, "LOW", "") 

# Save the output 
filterOut.save("C:/sapyexamples/output/filterout")

Environments

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

Licensing Information

  • ArcGIS for Desktop Basic: Requires Spatial Analyst
  • ArcGIS for Desktop Standard: Requires Spatial Analyst
  • ArcGIS for Desktop Advanced: Requires Spatial Analyst

Related Topics

  • An overview of the Neighborhood toolset
  • Calculating statistics for overlapping and non-overlapping neighborhoods
Feedback on this topic?

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

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

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal