ランク(Rank) (Spatial Analyst)

サマリ

一連の入力ラスタの値が、セルごとにランク付けされランク入力ラスタの値によって返される値が決定されます。

Rank illustration
OutRas = Rank(ConstRas, [InRas1, InRas2, InRas3])

使用法

構文

Rank (in_rank_raster_or_constant, in_rasters)
パラメータ説明データ タイプ
in_rank_raster_or_constant

返されるランク位置を定義する入力ラスタ。

数値を入力として使用できます。しかし、セル サイズと範囲を最初に環境で設定しておく必要があります。

Raster Layer | Constant
in_rasters
[in_raster,...]

入力ラスタのリスト。

入力は、ランクの値を識別する引数リストを定義します。ランクは、各セル位置ごとに最初の引数によって定義されます。

Raster Layer

リターン

名前説明データ タイプ
out_raster

出力ラスタ。

出力ラスタの各セルでは、入力ラスタの値が最小から最大へと並べ替えられ、入力ランク ラスタの値を使用して、出力値にする値が選択されます。

Raster

コードのサンプル

Rank(ランク)の例 1(Python ウィンドウ)

次の例では、複数の入力 Grid ラスタに対してランク操作を行い、TIFF ラスタとして結果を出力しています。

import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
outRank = Rank("cost", ["degs", "negs", "fourgrd"])
outRank.save("C:/sapyexamples/output/outrank.tif")
Rank(ランク)の例 2(スタンドアロン スクリプト)

次の例では、複数の入力 Grid ラスタに対してランク操作を行い、Grid ラスタとして結果を出力しています。

# Name: Rank_Ex_02.py
# Description: Returns the value of a set of rasters based on
#              a rank level specified by another raster 
# 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
inRankRaster = "cost"
inRaster01 = "degs"
inRaster02 = "negs"
inRaster03 = "fourgrd"

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

# Execute Rank
outRank = Rank(inRankRaster, [inRaster01, inRaster02, inRaster03])

# Save the output 
outRank.save("C:/sapyexamples/output/outrank")

環境

関連項目

ライセンス情報

ArcView: 必須 Spatial Analyst
ArcEditor: 必須 Spatial Analyst
ArcInfo: 必須 Spatial Analyst

7/10/2012