Show Navigation | Hide Navigation
You are here:
Extensions > Spatial Analyst > Spatial Analyst functional reference > Zonal (Spatial Analyst)

ZonalMedian

Release 9.2
Last modified January 3, 2008
E-mail This Topic Printable Version Give Us Feedback

Print all topics in : "Zonal (Spatial Analyst)"


Related Topics

Records, in each output cell, the median values of all cells in the <value_grid> that belong to the same zone as the output cell. Zones are identified by the values of the cells in the input <zone_grid>.


Illustration

ZonalMedian illustration

Usage tips

Command line syntax
See Zonal Statistics

To perform the equivalent to map algebra ZonalMedian, set the statistics type to Median.

Scripting syntax
See Zonal Statistics

To perform the equivalent to map algebra ZonalMedian, set the statistics type to Median.

Map Algebra syntax
ZonalMedian(<zone_grid>, <value_grid>, {DATA | NODATA})

Parameter Explanation
<zone_grid> An integer raster that identifies the zone for each cell.
The zone raster can be an expression resulting in a raster.
<value_grid> An integer raster that defines the values of the cells in which the median is to be calculated.
The median of the values of the value raster in each zone will be assigned to every cell in that zone on the output raster. The value raster may be an expression resulting in a raster.
{DATA | NODATA} A keyword defining the manner in which NoData values on the <value_grid> that fall within a zone defined by the <zone_grid> will influence the output results.
  • DATA  — A keyword that specifies that if a NoData value exists in a cell on the value raster within any particular zone defined by <zone_grid>, the cell will be ignored, and only cells on the value raster that have data values within the zone will be used to determine the median value for the output.
  • NODATA  — A keyword that signifies that if a NoData value exists on the value raster within any particular zone defined by <zone_grid>, there is insufficient information to complete the calculation to determine the median of the values for all the cells within the zone, and the entire zone will receive the NoData value on the output raster.

Map Algebra example

zonalmedian(zonegrid, valuegrid)
zonalmedian(zonegrid, valuegrid, DATA)
zonalmedian(zonegrid, valuegrid, NODATA)
zonalmedian(zonegrid, (ingrid1 + ingrid2))
zonalmedian((ingrid1 + ingrid2), ingrid3, NODATA)
zonalmedian(reclass(ingrid1,tab1), int(ingrid2 div ingrid3 * 4))

ArcObjects syntax
See Zonal Statistics

To perform ZonalMedian using ArcObjects, use the IZonalOp::ZonalStatistics method from the RasterZonalOp object specifying esriGeoAnalysisZonalStatsMedian as the esriGeoAnalysisZonalStatisticsEnum.

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.