ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

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

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Zonal Fill

Available with Spatial Analyst license.

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Fills zones using the minimum cell value from a weight raster along the zone boundary.

Usage

  • The input zone raster can be integer or floating point. Note that this is an exception to the other zonal tools, which require the zone input to be integer type.

  • The data type of the output is the same as that of the input weight raster. If the values on the weight raster are floating point, the resultant output raster will be floating point. If the weight raster is integer, the output will be integer.

  • Zonal Fill can be used as part of a hydrological analysis to fill sinks to the minimum elevation of their watershed boundary.

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

Syntax

ZonalFill(in_zone_raster, in_weight_raster)
ParameterExplanationData Type
in_zone_raster

The input raster that defines the zones to be filled.

Raster Layer
in_weight_raster

Weight, or value, to be assigned to each zone.

Raster Layer

Return Value

NameExplanationData Type
out_raster

The output raster for which the zones have been filled.

Raster

Code sample

ZonalFill example 1 (Python window)

This example fills the zones in a raster with the minimum value from the weight raster along the zone boundary.

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
outZonalFill = ZonalFill("inzone", "zoneweight")
outZonalFill.save("C:/sapyexamples/output/zonefillout")
ZonalFill example 2 (stand-alone script)

This example fills the zones in a raster with the minimum value from the weight raster along the zone boundary.

# Name: ZonalFill_Ex_02.py
# Description: Fills zones using the minimum cell value from a weight 
#   raster, along the zone boundary.
# 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
inZoneRaster = "inzone"
zoneWeightRaster = "zoneweight"

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

# Execute ZonalStatistics
outZonalFill = ZonalFill(inZoneRaster, zoneWeightRaster)

# Save the output 
outZonalFill.save("C:/sapyexamples/output/zonefillout3")

Environments

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

Licensing information

  • Basic: Requires Spatial Analyst
  • Standard: Requires Spatial Analyst
  • Advanced: Requires Spatial Analyst

Related topics

  • An overview of the Zonal toolset

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS Platform

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

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2019 Esri. | Privacy | Legal