Slice (3D Analyst)

Available with Spatial Analyst license.

Available with 3D Analyst license.

Summary

Slices or reclassifies the range of values of the input cells into zones (classes). The available data classification methods are equal interval, equal area (quantile), natural breaks, standard deviation (mean-centered), standard deviation (mean as a break), defined interval, and geometric interval.

Usage

  • The following options are available for the Slice method parameter. They generate output zones with different characteristics.

    • Equal area—The output raster will have the defined number of zones, with a similar number of cells in each zone.
    • Equal interval—The output raster will have the defined number of zones, each containing equal value ranges.
    • Natural breaks and Geometric interval—The output raster will have the specified number of zones, with the number of cells in each determined by the class breaks.
    • Standard deviation (mean-centered), Standard deviation (mean as a break), and Defined interval—The output raster will have the number of zones determined by the Interval size parameter value, with the number of cells in each determined by the class breaks.

  • Depending on the specified slice method, either the Number of output zones parameter value or the Interval size parameter value must be specified.

    • The Number of output zones parameter is required when using the Equal area, Equal interval, Natural breaks, or Geometric interval slice method.
    • The Interval size parameter is required when using the Defined interval, Standard deviation (mean-centered), or Standard deviation (mean as a break) slice method.

  • You can use the Change NoData to value for output parameter to replace NoData values with an integer value in the output. If you need to prevent NoData cells from being combined with any output zones, specify an integer value that is outside the expected range of output zones. For example, with output zones ranging from 1 to 5, specify a value that is less than 1 or larger than 5. Candidate values include 0, 100, and -99. To merge NoData values into an existing zone, use the integer value for this zone. If this parameter is not set, input NoData cells will remain as NoData in the output raster.

Parameters

LabelExplanationData Type
Input raster

The input raster to be reclassified.

Raster Layer
Output raster

The output reclassified raster.

The output will always be of integer type.

The attribute table of the output raster will have two new fields in addition to the standard ObjectID, Value, and Count fields. The Value field indicates the class value. The ZoneMin and ZoneMax fields record the minimum and maximum values, respectively, used for generating a class.

Raster Dataset
Number of output zones
(Optional)

The number of zones that the input raster will be reclassified into.

This parameter is required when the Slice method parameter value is Equal area, Equal interval, Natural breaks, or Geometric interval.

When the Slice method parameter value is Defined interval, Standard deviation (mean-centered), or Standard deviation (mean as a break), the Number of output zones parameter will be inactive. The number of output zones will be determined by the Interval size parameter value.

Long
Slice method
(Optional)

Specifies the manner in which the input raster will be reclassified into zones.

  • Equal intervalThe range of input values will be equally divided into the specified number of output zones to determine the class breaks. This is the default.
  • Equal areaThe number of input cells will be equally divided into the specified number of output zones to determine the class breaks. Each zone will have a similar number of cells, indicating a similar amount of area.
  • Natural breaksThe class breaks will be determined in a way that minimizes the variance within classes and maximizes the variance between classes. The breaks are usually set at relatively big changes in the data values.
  • Standard deviation (mean-centered)The class breaks will be placed above and below the mean value at a specified interval size, such as 2, 1, or 0.5, in the unit of standard deviation, until reaching the minimum and maximum values of the input raster. Mean is not used as a break but centered by two class breaks. One break is at half of the specified interval size above the mean and the other is at half of the specified interval size below the mean. Standard deviation is calculated with the n-1 denominator, where n is the number of pixels with value.
  • Standard deviation (mean as a break)The mean value will be used as a class break. Other class breaks will be placed above and below the mean value at a specified interval size, such as 2, 1, or 0.5, in the unit of standard deviation, until reaching the minimum and maximum values of the input raster. Standard deviation is calculated with the n-1 denominator, where n is the number of pixels with value.
  • Defined intervalThe class breaks will be set to zero and a multiple of the specified interval size relative to zero. They will then be clipped to the minimum and maximum values of the input data for the first and last classes. For a value range that contains zero, zero will always be included as a break point.
  • Geometric intervalThe class breaks will be created based on class intervals that have a geometric series. This is a pattern in which the current value equals the previous value divided by a geometric coefficient. The geometric coefficient in this classifier can change once (to its inverse) to optimize the class ranges. The algorithm creates these geometrical intervals by minimizing the sum of squares of the number of elements in each class. This ensures that each class has approximately the same number of values and that the change between intervals is consistent.
String
Starting value for output
(Optional)

The starting value that will be used for zones (classes) on the output raster dataset.

Classes will be assigned integer values, increasing by 1 from the starting value.

The default starting value is 1.

Long
Change NoData to value for output
(Optional)

Replace NoData with a value in the output.

If this parameter is not set, NoData cells will remain as NoData in the output raster.

Long
Interval size
(Optional)

The size of the interval between classes.

This parameter is required when the Slice method parameter is set to Defined interval, Standard deviation (mean-centered), or Standard deviation (mean as a break).

If Defined interval is used, the interval size indicates the actual value range of a class used to calculate class breaks.

If Standard deviation (mean-centered) or Standard deviation (mean as a break) is used, the interval size indicates the number of standard deviations used to calculate class breaks.

Double

arcpy.ddd.Slice(in_raster, out_raster, {number_zones}, {slice_type}, {base_output_zone}, {nodata_to_value}, {class_interval_size})
NameExplanationData Type
in_raster

The input raster to be reclassified.

Raster Layer
out_raster

The output reclassified raster.

The output will always be of integer type.

The attribute table of the output raster will have two new fields in addition to the standard ObjectID, Value, and Count fields. The Value field indicates the class value. The ZoneMin and ZoneMax fields record the minimum and maximum values, respectively, used for generating a class.

Raster Dataset
number_zones
(Optional)

The number of zones that the input raster will be reclassified into.

This parameter is required when the slice_type parameter value is EQUAL_AREA, EQUAL_INTERVAL, NATURAL_BREAKS, or GEOMETRIC_INTERVAL.

When the slice_type parameter value is STANDARD_DEVIATION_MEAN_CENTERED, STANDARD_DEVIATION_MEAN_BREAK, or DEFINED_INTERVAL, the number_zones parameter is not supported. The number of output zones will be determined by the class_interval_size parameter value.

Long
slice_type
(Optional)

Specifies the manner in which the input raster will be reclassified into zones.

  • EQUAL_INTERVALThe range of input values will be equally divided into the specified number of output zones to determine the class breaks. This is the default.
  • EQUAL_AREAThe number of input cells will be equally divided into the specified number of output zones to determine the class breaks. Each zone will have a similar number of cells, indicating a similar amount of area.
  • NATURAL_BREAKSThe class breaks will be determined in a way that minimizes the variance within classes and maximizes the variance between classes. The breaks are usually set at relatively big changes in the data values.
  • STANDARD_DEVIATION_MEAN_CENTEREDThe class breaks will be placed above and below the mean value at a specified interval size, such as 2, 1, or 0.5, in the unit of standard deviation, until reaching the minimum and maximum values of the input raster. Mean is not used as a break but centered by two class breaks. One break is at half of the specified interval size above the mean and the other is at half of the specified interval size below the mean. Standard deviation is calculated with the n-1 denominator, where n is the number of pixels with value.
  • STANDARD_DEVIATION_MEAN_BREAKThe mean value will be used as a class break. Other class breaks will be placed above and below the mean value at a specified interval size, such as 2, 1, or 0.5, in the unit of standard deviation, until reaching the minimum and maximum values of the input raster. Standard deviation is calculated with the n-1 denominator, where n is the number of pixels with value.
  • DEFINED_INTERVALThe class breaks will be set to zero and a multiple of the specified interval size relative to zero. They will then be clipped to the minimum and maximum values of the input data for the first and last classes. For a value range that contains zero, zero will always be included as a break point.
  • GEOMETRIC_INTERVALThe class breaks will be created based on class intervals that have a geometric series. This is a pattern in which the current value equals the previous value divided by a geometric coefficient. The geometric coefficient in this classifier can change once (to its inverse) to optimize the class ranges. The algorithm creates these geometrical intervals by minimizing the sum of squares of the number of elements in each class. This ensures that each class has approximately the same number of values and that the change between intervals is consistent.
String
base_output_zone
(Optional)

The starting value that will be used for zones (classes) on the output raster dataset.

Classes will be assigned integer values, increasing by 1 from the starting value.

The default starting value is 1.

Long
nodata_to_value
(Optional)

Replace NoData with a value in the output.

If this parameter is not set, NoData cells will remain as NoData in the output raster.

Long
class_interval_size
(Optional)

The size of the interval between classes.

This parameter is required when the slice_type parameter is set to DEFINED_INTERVAL, STANDARD_DEVIATION_MEAN_CENTERED, or STANDARD_DEVIATION_MEAN_BREAK.

If DEFINED_INTERVAL is used, the interval size indicates the actual value range of a class used to calculate class breaks.

If STANDARD_DEVIATION_MEAN_CENTERED or STANDARD_DEVIATION_MEAN_BREAK is used, the interval size indicates the number of standard deviations used to calculate class breaks.

Double

Code sample

Slice example 1 (Python window)

Reclassify the input raster into five classes based on natural groupings inherent in the data.

import arcpy
from arcpy import env
env.workspace = "C:/data"
arcpy.Slice_3d("elevation", "c:/output/elev_slice.tif", 5, "NATURAL_BREAKS")
Slice example 2 (Python window)

Reclassify the input raster with a defined interval equal to 10.

import arcpy
from arcpy import env
env.workspace = "C:/data"
arcpy.Slice_3d("elevation", "c:/output/elev_slice_02.tif", "", "DEFINED_INTERVAL", "", "", 10)
Slice example 3 (stand-alone script)

Reclassify the input raster into 10 classes based on natural groupings inherent in the data, and specify the starting value for output classes to be -5.

# Name: Slice_3d_Ex_03.py
# Description: Slices the input raster into 10 zones(classes) based on natural groupings inherent in the data
#              Specify the starting value for output classes to be -5.
# Requirements: 3D Analyst Extension

# Import system modules
import arcpy
from arcpy import env

# Set environment settings
env.workspace = "C:/data"

# Set local variables
inRaster = "elevation"
outRaster = "C:/output/elev_slice_03.tif"
numberZones = 10
baseOutputZone = -5

# Execute Slice
arcpy.Slice_3d(inRaster, outRaster, numberZones, "NATURAL_BREAKS", baseOutputZone)
Slice example 4 (stand-alone script)

Reclassify the input raster into 10 equal area classes. Assign NoData cells to have a value of -99 in the output.

# Name: Slice_3d_Ex_04.py
# Description: Slices the input raster into 10 zones(classes) based on equal area.
#              Assign NoData cells to have a value of -99 in the output.
# Requirements: 3D Analyst Extension

# Import system modules
import arcpy
from arcpy import env

# Set environment settings
env.workspace = "C:/data"

# Set local variables
inRaster = "elevation"
outRaster = "C:/output/elev_slice_04.tif"
numberZones = 10
baseOutputZone = 5
nodataToValue = -99
classIntervalSize = "" # or None

# Execute Slice
arcpy.Slice_3d(inRaster, outRaster, numberZones, "EQUAL_AREA", baseOutputZone, nodataToValue, classIntervalSize)

Licensing information

  • Basic: Requires 3D Analyst or Spatial Analyst
  • Standard: Requires 3D Analyst or Spatial Analyst
  • Advanced: Requires 3D Analyst or Spatial Analyst

Related topics