arcpy.3d.Slice(in_raster, out_raster, {number_zones}, {slice_type}, {base_output_zone}, {nodata_to_value}, {class_interval_size})
|
名前
|
説明
|
データ タイプ
|
|
in_raster
|
再分類対象の入力ラスター。
|
Raster Layer
|
|
out_raster
|
出力再分類ラスター。
出力は常に整数タイプになります。
出力ラスターの属性テーブルには、標準の ObjectID、Value、Count フィールドに加えて、新しく 2 つのフィールドが含まれます。 Value フィールドはクラス値を示します。 ZoneMin および ZoneMax フィールドにはそれぞれ最小値と最大値が記録され、クラスの生成に使用されます。
|
Raster Dataset
|
|
number_zones
(オプション)
|
入力ラスターを再分類するゾーンの数。
このパラメーターは、slice_type パラメーター値が EQUAL_AREA、EQUAL_INTERVAL、NATURAL_BREAKS、または GEOMETRIC_INTERVAL の場合に必須です。
slice_type パラメーター値が STANDARD_DEVIATION_MEAN_CENTERED、STANDARD_DEVIATION_MEAN_BREAK、または DEFINED_INTERVAL の場合、number_zones パラメーターはサポートされません。 出力ゾーン数は class_interval_size パラメーター値によって決定されます。
|
Long
|
|
slice_type
(オプション)
|
入力ラスターをゾーンに再分類する方法を指定します。
EQUAL_INTERVAL—The 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_AREA—The 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_BREAKS—The 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_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_INTERVAL—The 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_INTERVAL—The 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
(オプション)
|
出力ラスター データセットのゾーン (クラス) に使用される開始値です。
クラスには整数値が割り当てられ、開始値から 1 ずつ増加します。
デフォルトの開始値は 1 です。
|
Long
|
|
nodata_to_value
(オプション)
|
出力で NoData を値に置き換えます。
このパラメーターが設定されていない場合、NoData セルは出力ラスターで NoData のままになります。
|
Long
|
|
class_interval_size
(オプション)
|
クラス間の間隔のサイズです。
このパラメーターは、slice_type パラメーターが DEFINED_INTERVAL、STANDARD_DEVIATION_MEAN_CENTERED、または STANDARD_DEVIATION_MEAN_BREAK に設定されている場合に必須です。
DEFINED_INTERVAL を使用する場合、間隔サイズは、クラス閾値の計算に使用するクラスの実際の値範囲を示します。
STANDARD_DEVIATION_MEAN_CENTERED または STANDARD_DEVIATION_MEAN_BREAK を使用する場合、間隔サイズは、クラス閾値の計算に使用する標準偏差の数値を示します。
|
Double
|
コードのサンプル
Slice の例 1 (Python ウィンドウ)
入力ラスターを、データに内在する自然なグループに基づいて 5 つのクラスに再分類します。
import arcpy
from arcpy import env
env.workspace = "C:/data"
arcpy.ddd.Slice("elevation", "c:/output/elev_slice.tif", 5, "NATURAL_BREAKS")
Slice の例 2 (Python ウィンドウ)
入力ラスターを、指定間隔を 10 にして再分類します。
import arcpy
from arcpy import env
env.workspace = "C:/data"
arcpy.ddd.Slice("elevation", "c:/output/elev_slice_02.tif", "", "DEFINED_INTERVAL", "", "", 10)
Slice の例 3 (スタンドアロン スクリプト)
入力ラスターを、データに内在する自然なグループに基づいて 10 のクラスに再分類し、出力クラスの開始値を -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
# Run Slice
arcpy.ddd.Slice(inRaster, outRaster, numberZones, "NATURAL_BREAKS", baseOutputZone)
Slice の例 4 (スタンドアロン スクリプト)
入力ラスターを、10 の等面積のクラスに再分類します。 出力に -99 の値を含むように NoData セルを割り当てます。
# 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
# Run Slice
arcpy.ddd.Slice(inRaster, outRaster, numberZones, "EQUAL_AREA", baseOutputZone, nodataToValue, classIntervalSize)