Fill (Spatial Analyst)

License Level:BasicStandardAdvanced

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 value for Z-limit must be greater than zero.

Unless a value is specified for this parameter, all sinks will be filled, 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

# 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

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