ListDatasets (arcpy)
サマリ
Lists all of the datasets in a workspace. Search conditions can be specified for the dataset name and dataset type to limit the Python List that is returned.
説明
The workspace environment must be set first before using several of the List functions, including ListDatasets, ListFeatureClasses, ListFiles, ListRasters, ListTables, and ListWorkspaces.
構文
ListDatasets ({wild_card}, {feature_type})
パラメータ | 説明 | データ タイプ |
wild_card |
ワイルドカードを使用して、返される結果を絞り込むことができます。ワイルドカードを指定しない場合は、すべての値が返されます。 | String |
feature_type |
The feature type to limit the results returned by the wildcard argument. Valid dataset types are:
(デフォルト値は次のとおりです All) | String |
データ タイプ | 説明 |
String |
A list containing dataset names returned from the function, limited by the wildcard and feature type arguments. |
コードのサンプル
ListDatasets example
List Feature Dataset names that start with C.
import arcpy
arcpy.env.workspace = "C:/Data"
# Print to the Interactive window all the feature datasets in the workspace
# that start with the letter C.
#
datasetList = arcpy.ListDatasets("C*", "Feature")
for dataset in datasetList:
print dataset
関連トピック
9/14/2013