Zonal Fill (Spatial Analyst)

License Level:BasicStandardAdvanced

Summary

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

Usage

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

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