ArcToolbox → [データ管理ツール] → [フィールド] → [フィールドの削除]
○バッファのレイヤ
○抽出したいデータセットを含むレイヤ
[ArcToolbox] → [解析ツール] → [オーバーレイ] → [インターセクト] をダブルクリックする
[入力フィーチャ] に上記二つのファイルを設定(今回は、バッファレイヤ→データレイヤの順で入力)
[出力フィーチャクラス] でデータの出力先と名前を設定
以上の設定ができたら [OK] をクリック
○抽出したいデータセットを含むレイヤ
[ArcToolbox] → [解析ツール] → [オーバーレイ] → [インターセクト] をダブルクリックする
[入力フィーチャ] に上記二つのファイルを設定(今回は、バッファレイヤ→データレイヤの順で入力)
[出力フィーチャクラス] でデータの出力先と名前を設定
以上の設定ができたら [OK] をクリック
==コードブロック内ウィンドウ==
Pre-Logic Script Code:
def Reclass(data):
if (data >= 50):
return "50m-"
elif (data < 50 and data >= 49):
return "49m-50m"
elif (data < 49 and data >= 48):
return "48m-49m"
elif (data < 48 and data >= 47):
return "47m-48m"
elif (data < 47 and data >= 46):
return "46m-47m"
elif (data < 46 and data >= 45):
return "45m-46m"
elif (data < 45 and data >= 44):
return "44m-45m"
elif (data < 44 and data >= 43):
return "43m-44m"
elif (data < 43 and data >= 42):
return "42m-43m"
elif (data < 42 and data >= 41):
return "41m-42m"
elif (data < 41 and data >= 40):
return "40m-41m"
elif (data < 40 and data >= 39):
return "39m-40m"
elif (data < 39 and data >= 38):
return "38m-39m"
elif (data < 38 and data >= 37):
return "37m-38m"
elif (data < 37 and data >= 36):
return "36m-37m"
elif (data < 36 and data >= 35):
return "35m-36m"
elif (data < 35 and data >= 34):
return "34m-35m"
elif (data < 34 and data >= 33):
return "33m-34m"
elif (data < 33 and data >= 32):
return "32m-33m"
elif (data < 32 and data >= 31):
return "31m-32m"
elif (data < 31 and data >= 30):
return "30m-31m"
elif (data < 30 and data >= 29):
return "29m-30m"
elif (data < 29 and data >= 28):
return "28m-29m"
elif (data < 28 and data >= 27):
return "27m-28m"
elif (data < 27 and data >= 26):
return "26m-27m"
elif (data < 26 and data >= 25):
return "25m-26m"
elif (data < 25 and data >= 24):
return "24m-25m"
elif (data < 24 and data >= 23):
return "23m-24m"
elif (data < 23 and data >= 22):
return "22m-23m"
elif (data < 22 and data >= 21):
return "21m-22m"
elif (data < 21 and data >= 20):
return "20m-21m"
elif (data < 20 and data >= 19):
return "19m-20m"
elif (data < 19 and data >= 18):
return "18m-19m"
elif (data < 18 and data >= 17):
return "17m-18m"
elif (data < 17 and data >= 16):
return "16m-17m"
elif (data < 16 and data >= 15):
return "15m-16m"
elif (data < 15 and data >= 14):
return "14m-15m"
elif (data < 14 and data >= 13):
return "13m-14m"
elif (data < 13 and data >= 12):
return "12m-13m"
elif (data < 12 and data >= 11):
return "11m-12m"
elif (data < 11 and data >= 10):
return "10m-11m"
elif (data < 10 and data >= 9):
return "09m-10m"
elif (data < 9 and data >= 8):
return "08m-09m"
elif (data < 8 and data >= 7):
return "07m-08m"
elif (data < 7 and data >= 6):
return "06m-07m"
elif (data < 6 and data >= 5):
return "05m-06m"
elif (data < 5 and data >= 4):
return "04m-05m"
elif (data < 4 and data >= 3):
return "03m-04m"
elif (data < 3 and data >= 2):
return "02m-03m"
elif (data < 2 and data >= 1):
return "01m-02m"
elif (data < 1 and data >= -99):
return "00m-01m"
else:
return ""
------------------------------------------------------
count=
Reclass(!elevation!)
Pre-Logic Script Code:
def Reclass(data):
if (data >= 50):
return "50m-"
elif (data < 50 and data >= 49):
return "49m-50m"
elif (data < 49 and data >= 48):
return "48m-49m"
elif (data < 48 and data >= 47):
return "47m-48m"
elif (data < 47 and data >= 46):
return "46m-47m"
elif (data < 46 and data >= 45):
return "45m-46m"
elif (data < 45 and data >= 44):
return "44m-45m"
elif (data < 44 and data >= 43):
return "43m-44m"
elif (data < 43 and data >= 42):
return "42m-43m"
elif (data < 42 and data >= 41):
return "41m-42m"
elif (data < 41 and data >= 40):
return "40m-41m"
elif (data < 40 and data >= 39):
return "39m-40m"
elif (data < 39 and data >= 38):
return "38m-39m"
elif (data < 38 and data >= 37):
return "37m-38m"
elif (data < 37 and data >= 36):
return "36m-37m"
elif (data < 36 and data >= 35):
return "35m-36m"
elif (data < 35 and data >= 34):
return "34m-35m"
elif (data < 34 and data >= 33):
return "33m-34m"
elif (data < 33 and data >= 32):
return "32m-33m"
elif (data < 32 and data >= 31):
return "31m-32m"
elif (data < 31 and data >= 30):
return "30m-31m"
elif (data < 30 and data >= 29):
return "29m-30m"
elif (data < 29 and data >= 28):
return "28m-29m"
elif (data < 28 and data >= 27):
return "27m-28m"
elif (data < 27 and data >= 26):
return "26m-27m"
elif (data < 26 and data >= 25):
return "25m-26m"
elif (data < 25 and data >= 24):
return "24m-25m"
elif (data < 24 and data >= 23):
return "23m-24m"
elif (data < 23 and data >= 22):
return "22m-23m"
elif (data < 22 and data >= 21):
return "21m-22m"
elif (data < 21 and data >= 20):
return "20m-21m"
elif (data < 20 and data >= 19):
return "19m-20m"
elif (data < 19 and data >= 18):
return "18m-19m"
elif (data < 18 and data >= 17):
return "17m-18m"
elif (data < 17 and data >= 16):
return "16m-17m"
elif (data < 16 and data >= 15):
return "15m-16m"
elif (data < 15 and data >= 14):
return "14m-15m"
elif (data < 14 and data >= 13):
return "13m-14m"
elif (data < 13 and data >= 12):
return "12m-13m"
elif (data < 12 and data >= 11):
return "11m-12m"
elif (data < 11 and data >= 10):
return "10m-11m"
elif (data < 10 and data >= 9):
return "09m-10m"
elif (data < 9 and data >= 8):
return "08m-09m"
elif (data < 8 and data >= 7):
return "07m-08m"
elif (data < 7 and data >= 6):
return "06m-07m"
elif (data < 6 and data >= 5):
return "05m-06m"
elif (data < 5 and data >= 4):
return "04m-05m"
elif (data < 4 and data >= 3):
return "03m-04m"
elif (data < 3 and data >= 2):
return "02m-03m"
elif (data < 2 and data >= 1):
return "01m-02m"
elif (data < 1 and data >= -99):
return "00m-01m"
else:
return ""
------------------------------------------------------
count=
Reclass(!elevation!)
[ラスタの属性テーブルの構築] ツールを使うことでシングルバンドの整数ラスタデータセットであれば属性テーブルを持たせることが可能。もし、ラスタデータのピクセルタイプが32ビット浮動小数点の場合は、ピクセルタイプを整数にすることで属性テーブルの作成が行えるようになる。
(ESRI詳細地図のDEMは標高の区切りが整数となっている)
ピクセルタイプを整数にする方法
(方法1)
[Arctoolbox] → [Spatial Analystツール] → [算術演算] → [Int] にてピクセルタイプを整数にする。
(方法2)
[Arctoolbox] → [3D Analystツール] → [ラスタの算術演算] → [Int] にてピクセルタイプを整数にする
ラスタに属性テーブルを構築
1. [ArcToolbox] → [データ管理ツール] → [ラスタ] → [ラスタプロパティ] → [ラスタの属性テーブルの構築] をダブルクリックする。
2. ダイアログが開いたら、[入力ラスタ] に属性テーブルを持たせたいラスタデータを設定。
3. 設定ができたら [OK] をクリック。
属性テーブルには「OBJECT」「VALUE」「COUNT」の3つのフィールドが作成される。
「OBJECT」には、ベクタデータと同じでIDが表示。
「VALUE」には、コード値や標高値などが表示。
「COUNT」には、各VALUEの値が対応しているセルの数が表示。
この3つのフィールドは自動的に作成されるので、ユーザが属性を作成するといった作業は必要ない。
また、ラスタデータの属性テーブルは上記のデータを管理し、これら3つのフィールドの値を編集することはできないが、フィールドを追加してラスタデータの値に補足的な情報を値として入力することは可能。
なお、属性テーブルを作成した場合でも、ラスタ データはセル 1 つ 1 つの値を直接編集することはできない。Spatial Analyst の機能を使用することで、同じ値を持つセルごとであれば、値の変更や演算を行うことは可能。
標高値が格納しているラスタから、データの範囲を抽出したい。
シェープファイルなら、[解析 ツール] → [抽出] → [選択]と同様の処理
ラスタ データは、格子状に並んだセル(セル値という数値を持つ)で全体は四角形という構造であるため、次のような処理を行う
● 標高値が格納されているラスタをもとに、削除したいデータの範囲を指定して、その部分のセル値を「値なし」という意味の値に変更したラスタを作成する。
2通りのやり方があり、どちらも Spatial Analyst エクステンションが必要
◆「値なし」という意味で「NULL」値を使用する手順
ArcToolbox → [Spatial Analyst] ツール → [条件] → [Set NULL]
ツールの [条件式] パラメーターには、例として次のようなものを入力します。
"Value" >= 0 And "Value" < 50
※ 条件式を確認して「条件式にエラーがあります。」となることもありますが、実行すると実施可能となる場合有
◆「値なし」という意味で、自分で決めた数値またはNULLを使用する手順
上にご紹介した Set Null ツールより、こちらのほうがより自由度が高いツール。
ArcToolbox → [Spatial Analyst ツール] → [マップ代数演算] → [ラスタ演算(Raster Calculator)]
演算式には、例として次のようなものを入力する。
Con("<ラスタ データセット名>" < 50 , -999, "<ラスタ データセット名>")
シェープファイルなら、[解析 ツール] → [抽出] → [選択]と同様の処理
ラスタ データは、格子状に並んだセル(セル値という数値を持つ)で全体は四角形という構造であるため、次のような処理を行う
● 標高値が格納されているラスタをもとに、削除したいデータの範囲を指定して、その部分のセル値を「値なし」という意味の値に変更したラスタを作成する。
2通りのやり方があり、どちらも Spatial Analyst エクステンションが必要
◆「値なし」という意味で「NULL」値を使用する手順
ArcToolbox → [Spatial Analyst] ツール → [条件] → [Set NULL]
ツールの [条件式] パラメーターには、例として次のようなものを入力します。
"Value" >= 0 And "Value" < 50
※ 条件式を確認して「条件式にエラーがあります。」となることもありますが、実行すると実施可能となる場合有
◆「値なし」という意味で、自分で決めた数値またはNULLを使用する手順
上にご紹介した Set Null ツールより、こちらのほうがより自由度が高いツール。
ArcToolbox → [Spatial Analyst ツール] → [マップ代数演算] → [ラスタ演算(Raster Calculator)]
演算式には、例として次のようなものを入力する。
Con("<ラスタ データセット名>" < 50 , -999, "<ラスタ データセット名>")