arcpy.cartography.GridIndexFeatures(out_feature_class, {in_features}, {intersect_feature}, {use_page_unit}, {scale}, {polygon_width}, {polygon_height}, {origin_coord}, {number_rows}, {number_columns}, {starting_page_number}, {label_from_origin})
|
名前
|
説明
|
データ タイプ
|
|
out_feature_class
|
ポリゴン インデックス フィーチャの結果として出力されるフィーチャクラス。
出力フィーチャクラスの座標系は以下の順に決定されます。
座標系が出力座標系環境で指定されている場合、その出力フィーチャクラスはこの座標系を使用します。
座標系が出力座標系環境で指定されていない場合、出力フィーチャクラスはアクティブなマップ (ArcGIS Pro が開いている) の座標系を使用します。
座標系が出力座標系環境で指定されておらず、アクティブなマップも存在しない (ArcGIS Pro が開いていない) 場合、出力フィーチャクラスは最初の入力フィーチャの座標系を使用します。
座標系が出力座標系環境で指定されておらず、アクティブなマップが存在せず (ArcGIS Pro が開いていない)、入力フィーチャも指定されていない場合、出力フィーチャクラスの座標系は不明になります。
|
Feature Class
|
|
in_features
[in_features,...]
(オプション)
|
作成対象のポリゴン グリッドの範囲の定義に使用する入力フィーチャ。
|
Feature Layer; Raster Layer
|
|
intersect_feature
(オプション)
|
出力のグリッド フィーチャクラスを、入力フィーチャ レイヤーまたはデータセットと交差する領域に制限します。 入力フィーチャの交差部が、インデックス フィーチャの作成に使用されます。
|
Boolean
|
|
use_page_unit
(オプション)
|
インデックス ポリゴン サイズの入力をページ単位に含めるかどうかを指定します。
|
Boolean
|
|
scale
(オプション)
|
マップ縮尺。 インデックス ポリゴンの高さと幅をページ単位で計算する予定がある場合は、縮尺を指定する必要があります。 アクティブな ArcGIS Pro セッションの外部でツールを使用している場合、デフォルトの縮尺値は 1 です。
|
Long
|
|
polygon_width
(オプション)
|
マップ単位またはページ単位のどちらかで指定されたインデックス ポリゴンの幅。 ページ単位を使用した場合、デフォルト値は 1 インチです。 マップ単位を使用した場合、デフォルト値は 1 度です。
|
Linear Unit
|
|
polygon_height
(オプション)
|
マップ単位またはページ単位のどちらかで指定されたインデックス ポリゴンの高さ。 ページ単位を使用した場合、デフォルト値は 1 インチです。 マップ単位を使用した場合、デフォルト値は 1 度です。
|
Linear Unit
|
|
origin_coord
(オプション)
|
出力グリッド フィーチャクラスの左下の原点座標値。 入力フィーチャを指定した場合、指定されたフィーチャの範囲の結合範囲によってデフォルト値が算出されます。 入力フィーチャを指定しない場合、デフォルトの座標は 0、0 です。
|
Point
|
|
number_rows
(オプション)
|
原点を基点として Y 方向に作成する行の数。 デフォルトは 10 です。
|
Long
|
|
number_columns
(オプション)
|
原点を基点として X 方向に作成する列の数。 デフォルトは 10 です。
|
Long
|
|
starting_page_number
(オプション)
|
各グリッド インデックス フィーチャに、指定した開始ページ番号から始まる連続ページ番号が割り当てられます。 デフォルトは 1 です。
|
Long
|
|
label_from_origin
(オプション)
|
ページ番号 (ラベル) が始まる場所を指定します。
|
Boolean
|
コードのサンプル
GridIndexFeatures の例 1 (Python ウィンドウ)
次の例では、入力フィーチャの交差部を使用し、指定したインデックス フィーチャのマップ単位のディメンションを使用して、インデックス フィーチャ (格子状) を作成します。
import arcpy
arcpy.env.workspace = "C:\\data\\ProjectData.gdb"
arcpy.cartography.GridIndexFeatures("gridIndexFeatures","poly", "", "", "",
"1000 meters", "1000 meters")
GridIndexFeatures の例 2 (Python ウィンドウ)
次の例では、入力フィーチャの全範囲を使用し、指定したインデックス フィーチャのページ単位のディメンションを使用して、インデックス フィーチャ (格子状) を作成します。
import arcpy
arcpy.env.workspace = "C:\\data\\ProjectData.gdb"
arcpy.cartography.GridIndexFeatures("gridIndexFeatures","poly",
"NO_INTERSECTFEATURE", "USEPAGEUNIT",
"100000", "5 inches", "5 inches")
GridIndexFeatures の例 3 (Python ウィンドウ)
次の例では、入力フィーチャの交差部を使用し、指定したインデックス フィーチャのマップ単位のディメンションを使用して、開始ページ番号を 5 としたインデックス フィーチャ (格子状) を作成します。
import arcpy
arcpy.env.workspace = "C:\\data\\ProjectData.gdb"
arcpy.cartography.GridIndexFeatures("gridIndexFeatures","poly", "", "", "",
"1000 meters", "1000 meters", "", "",
"", "5")
GridIndexFeatures の例 4 (Python ウィンドウ)
次の例では、原点座標、インデックス フィーチャのマップ単位のディメンション、行数、および列数を指定して、インデックス フィーチャ (格子状) を作成します。
import arcpy
arcpy.env.workspace = "C:\\data\\ProjectData.gdb"
arcpy.cartography.GridIndexFeatures("gridIndexFeatures", "", "", "", "",
"1000 meters","1000 meters",
"-6000000 -1600000", "15", "20")
GridIndexFeatures の例 5 (Python ウィンドウ)
次の例では、原点座標、インデックス フィーチャのページ単位のディメンション、行数、および列数を指定し、開始ページ番号を 5 とし、原点からラベリングを開始するように指定して、インデックス フィーチャ (格子状) を作成します。
import arcpy
arcpy.env.workspace = "C:\\data\\ProjectData.gdb"
arcpy.cartography.GridIndexFeatures("gridIndexFeatures", "", "", "USEPAGEUNIT",
"100000", "5 inches", "5 inches",
"-6000000 -1600000", "15", "20", "5",
"LABELFROMORIGIN")
GridIndexFeatures の例 6 (スタンドアロン スクリプト)
次の例では、入力フィーチャの交差部を使用し、指定したインデックス フィーチャのマップ単位のディメンションを使用して、インデックス フィーチャ (格子状) を作成します。
# gridindexfeatures_example1.py
# Description: Creates Grid Index Features using the intersection of input
# features and specified index feature dimensions in map units
# Import system modules
import arcpy
# Set environment settings
arcpy.env.workspace = "C:\\data\\ProjectData.gdb"
# Set local variables
outFeatureClass = "gridIndexFeatures"
inFeatures = "poly"
polygonWidth = "1000 meters"
polygonHeight= "1000 meters"
# Run GridIndexFeatures
arcpy.cartography.GridIndexFeatures(outFeatureClass,inFeatures, "", "", "",
polygonWidth, polygonHeight)
GridIndexFeatures の例 7 (スタンドアロン スクリプト)
次の例では、入力フィーチャの全範囲を使用し、指定したインデックス フィーチャのページ単位のディメンションを使用して、インデックス フィーチャ (格子状) を作成します。
# gridindexfeatures_example2.py
# Description: Creates Grid Index Features using the entire extent of input
# features and specified index feature dimensions in page units
# Import system modules
import arcpy
# Set environment settings
arcpy.env.workspace = "C:\\data\\ProjectData.gdb"
# Set local variables
outFeatureClass = "gridIndexFeatures"
inFeatures = "poly"
noIntersect = "NO_INTERSECTFEATURE"
usePageUnit = "USEPAGEUNIT"
scale = "100000"
polygonWidth = "5 inches"
polygonHeight= "5 inches"
# Run GridIndexFeatures
arcpy.cartography.GridIndexFeatures(outFeatureClass, inFeatures, noIntersect,
usePageUnit, scale, polygonWidth,
polygonHeight)
GridIndexFeatures の例 8 (スタンドアロン スクリプト)
次の例では、入力フィーチャの交差部を使用し、指定したインデックス フィーチャのマップ単位のディメンションを使用して、開始ページ番号を 5 としたインデックス フィーチャ (格子状) を作成します。
# gridindexfeatures_example3.py
# Description: Creates Grid Index Features using the intersection of input
# features, specified index feature dimensions in map units and 5 as the
# starting page number
# Import system modules
import arcpy
# Set environment settings
arcpy.env.workspace = "C:\\data\\ProjectData.gdb"
# Set local variables
outFeatureClass = "gridIndexFeatures"
inFeatures = "poly"
polygonWidth = "1000 meters"
polygonHeight= "1000 meters"
startingPageNum = "5"
# Run GridIndexFeatures
arcpy.cartography.GridIndexFeatures(outFeatureClass,inFeatures, "", "", "",
polygonWidth, polygonHeight, "", "", "",
startingPageNum)
GridIndexFeatures の例 9 (スタンドアロン スクリプト)
次の例では、原点座標、インデックス フィーチャのマップ単位のディメンション、行数、および列数を指定して、インデックス フィーチャ (格子状) を作成します。
# gridindexfeatures_example4.py
# Description: Creates Grid Index Features by specifying the origin
# coordinates, the index feature dimensions in map units, the number of
# rows and the number of columns
# Import system modules
import arcpy
# Set environment settings
arcpy.env.workspace = "C:\\data\\ProjectData.gdb"
arcpy.env.outputCoordinateSystem = arcpy.SpatialReference("North America Albers Equal Area Conic.prj")
# Set local variables
outFeatureClass = "gridIndexFeatures"
polygonWidth = "1000 meters"
polygonHeight= "1000 meters"
originCoord = "-6000000 -1600000"
numberRows = "15"
numberColumns = "20"
# Run GridIndexFeatures
arcpy.cartography.GridIndexFeatures(outFeatureClass, "", "", "", "",
polygonWidth, polygonHeight, originCoord,
numberRows, numberColumns)
GridIndexFeatures の例 10 (スタンドアロン スクリプト)
次の例では、原点座標、インデックス フィーチャのページ単位のディメンション、行数、および列数を指定し、開始ページ番号を 5 とし、原点からラベリングを開始するように指定して、インデックス フィーチャ (格子状) を作成します。
# gridindexfeatures_example5.py
# Description: Creates Grid Index Features by specifying the origin
# coordinates, the index feature dimensions in page units, the number of
# rows, the number of columns, 5 as the starting page number and labeling
# to start at the origin
# Import system modules
import arcpy
# Set environment settings
arcpy.env.workspace = "C:\\data\\ProjectData.gdb"
arcpy.env.outputCoordinateSystem = arcpy.SpatialReference("North America Albers Equal Area Conic.prj")
# Set local variables
outFeatureClass = "gridIndexFeatures"
usePageUnit = "USEPAGEUNIT"
scale = "100000"
polygonWidth = "1000 meters"
polygonHeight= "1000 meters"
originCoord = "-6000000 -1600000"
numberRows = "15"
numberColumns = "20"
startingPageNum = "5"
labeling = "LABELFROMORIGIN"
# Run GridIndexFeatures
arcpy.cartography.GridIndexFeatures(outFeatureClass, "", "", usePageUnit,
scale, polygonWidth, polygonHeight,
originCoord, numberRows, numberColumns,
startingPageNum, labeling)