Fill (Spatial Analyst)

Summary

Fills sinks in a surface raster to remove small imperfections in the data.

Learn more about how Fill works

Usage

Syntax

Fill (in_surface_raster, {z_limit})
ParameterExplanationData Type
in_surface_raster

The input raster representing a continuous surface.

Raster Layer
z_limit
(Optional)

Maximum elevation difference between a sink and its pour point to be filled.

If the difference in z-values between a sink and its pour point is greater than the z_limit that sink will not be filled.

The default is to fill all sinks, regardless of depth.

Double

Return Value

NameExplanationData Type
out_surface_raster

The output surface raster after the sinks have been filled.

Raster

Code Sample

Fill example 1 (Python window)

This example fills the sinks of an input elevation surface GRID raster.

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
outFill = Fill("elevation")
outFill.save("C:/sapyexamples/output/outfill01")
Fill example 2 (stand-alone script)

This example fills the sinks of an input elevation surface GRID raster with a z-limit applied.

# Name: Fill_Ex_02.py
# Description: Fills sinks in a surface raster.
# 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
inSurfaceRaster = "elevation"
zLimit = 3.28

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

# Execute FlowDirection
outFill = Fill(inSurfaceRaster, zLimit)

# Save the output 
outFill.save("C:/sapyexamples/output/outfill02")

Environments

Related Topics

Licensing Information

ArcView: Requires Spatial Analyst
ArcEditor: Requires Spatial Analyst
ArcInfo: Requires Spatial Analyst

6/29/2011