Boundary Clean (Spatial Analyst)

License Level:BasicStandardAdvanced

Summary

Smoothes the boundary between zones by expanding and shrinking it.

Learn more about how Boundary Clean works

Illustration

Boundary Clean illustration
OutRas = BoundaryClean(InRas1)

Usage

Syntax

BoundaryClean (in_raster, {sort_type}, {number_of_runs})
ParameterExplanationData Type
in_raster

The input raster for which the boundary between zones will be smoothed.

It must be of integer type.

Raster Layer
sort_type
(Optional)

Specifies the type of sorting to use in the smoothing process.

This determines the priority by which cells can expand into their neighbors.

  • NO_SORT Does no sorting by size. Zones with larger values have a higher priority to expand into zones with smaller values. This is the default.
  • DESCEND Sorts zones in descending order by size. Zones with larger total areas have a higher priority to expand into zones with smaller total areas.
  • ASCEND Sorts zones in ascending order by size. Zones with smaller total areas have a higher priority to expand into zones with larger total areas.
String
number_of_runs
(Optional)

Specifies the number of directions in which the smoothing process will take place.

  • TWO_WAY Performs expansion and shrinking according to sorting type, then performs an additional shrinking and expansion with the priority reversed. This is the default.
  • ONE_WAY Performs expansion and shrinking once, according to sorting type.
Boolean

Return Value

NameExplanationData Type
out_raster

The output generalized raster.

The boundaries between zones in the input will be smoothed.

Raster

Code Sample

BoundaryClean example 1 (Python window)

This example smooths the boundary between zones in a descending order with a two-way run.

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
OutBndCln = BoundaryClean("land", "DESCEND", "TWO_WAY")
OutBndCln.save("c:/sapyexamples/output/bndcln_des2")
BoundaryClean example 2 (stand-alone script)

This example smooths the boundary between zones in a descending order with a two-way run.

# Name: BoundaryClean_Ex_02.py
# Description: Smoothes the boundary between zones 
#              by expanding and shrinking it.
# 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 = "land"

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

# Execute BoundaryClean
OutBndCln = BoundaryClean(inRaster, "ASCEND", "TWO_WAY")

# Save the output 
OutBndCln.save("c:/sapyexamples/output/bndcln_asc2")

Environments

Related Topics

Licensing Information

ArcGIS for Desktop Basic: Requires Spatial Analyst
ArcGIS for Desktop Standard: Requires Spatial Analyst
ArcGIS for Desktop Advanced: Requires Spatial Analyst
4/10/2014