Fill

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

Learn more about how Fill works


Usage tips

Command line and Scripting

ArcObjects

Syntax

Fill_sa (in_surface_raster, out_surface_raster, z_limit)
Parameter Explanation Datatype
Input surface raster (Required)

The input raster representing a continuous surface.

Composite Geodataset
Output surface raster (Required)

The output surface raster after the sinks have been filled.

Raster Dataset
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
Data types for geoprocessing tool parameters

Script Example

# Fill_sample.py
# Description: 
#   Fills sinks in a surface raster to remove small imperfections in the data.
# Requirements: None
# Author: ESRI
# Date: Sept 6, 2005

# Import system modules
import arcgisscripting

# Create the Geoprocessor object
gp = arcgisscripting.create()

try:
    # Set local variables
    InSurfaceRaster "C:/data/dem"
    OutSurfaceRaster = "C:/data/filled_dem"
    InZLimit = "1.5"

    # Check out Spatial Analyst extension license
    gp.CheckOutExtension("Spatial")

    # Process: Fill
    gp.Fill_sa(InSurfaceRaster, OutSurfaceRaster, InZLimit)

except:
    # If an error occurred while running a tool, then print the messages.
    print gp.GetMessages()

Map Algebra syntax

Not Available


ArcObjects syntax

IHydrologyOp.Fill (surfaceRaster As IGeoDataset, [zLimit]) As IGeoDataset

Parameter Explanation
geoDataset A raster representing a continuous surface.
[zLimit] The maximum difference between a sink and its pour point or a peak and its highest adjacent neighbor. If the difference in z value between a sink and its pour point is greater than the [zLimit], that sink will not be filled. If the difference in z value between a peak and its highest adjacent neighbor is greater than the [zLimit], that peak will not be removed. The default is to fill all sinks (or remove all peaks), regardless of depth.

ArcObjects example

' Create the RasterHydrologyOp object
Dim pHydrologyOp As IHydrologyOp
Set pHydrologyOp = New RasterHydrologyOp

' Declare the input raster object
Dim pSurfaceRaster As IGeoDataset

' Calls function to open a raster dataset from disk
Set pSurfaceRaster = OpenRasterDataset ("D:\SpatialData", "surface")

' Declare the output raster object
Dim pOutputRaster As IGeoDataset

' Calls the method
Set pOutputRaster = pHydrologyOp.Fill (pSurfaceRaster)

See Also

  • Flow Accumulation
  • Flow Direction
  • Sink
  • An overview of the Hydrology tools