ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • ヘルプ
  • Sign Out
ArcGIS Desktop

ArcGIS Online

組織のマッピング プラットフォーム

ArcGIS Desktop

完全なプロ仕様の GIS

ArcGIS Enterprise

エンタープライズ GIS

ArcGIS Developers

位置情報利用アプリの開発ツール

ArcGIS Solutions

各種業界向けの無料のテンプレート マップおよびテンプレート アプリケーション

ArcGIS Marketplace

組織で使えるアプリとデータを取得

  • ドキュメント
  • サポート
Esri
  • サイン イン
user
  • マイ プロフィール
  • サイン アウト

ArcMap

  • ホーム
  • はじめに
  • マップ
  • 解析
  • データ管理
  • ツール
  • エクステンション

ListFeatureClasses

  • 概要
  • ディスカッション
  • 構文
  • コードのサンプル

概要

Returns a list of the feature classes in the current workspace, limited by name, feature type, and optional feature dataset.

ディスカッション

The workspace environment must be set before using several of the list functions, including ListDatasets, ListFeatureClasses, ListFiles, ListRasters, ListTables, and ListWorkspaces.

構文

ListFeatureClasses ({wild_card}, {feature_type}, {feature_dataset})
パラメーター説明データ タイプ
wild_card

Limits the results returned. If a value is not specified, all values are returned. The wildcard is not case sensitive.

SymbolDescriptionExample

*

Represents zero or more characters.

Te* finds Tennessee and Texas.

String
feature_type

The feature type that will limit the results. Valid feature types are listed in the following table:

  • Annotation —Annotation feature classes
  • Arc —Arc (or polyline) feature classes
  • Dimension —Dimension feature classes
  • Edge —Edge feature classes
  • Junction —Junction feature classes
  • Label — Label feature classes
  • Line —Polyline (or arc) feature classes
  • Multipatch —Multipatch feature classes
  • Multipoint —Multipoint feature class
  • Node —Node feature classes
  • Point —Point feature classes
  • Polygon —Polygon feature classes
  • Polyline —Polyline (or arc) feature classes
  • Region —Region feature classes
  • Route —Route feature classes
  • Tic —Tic feature classes
  • All — All feature classes in the workspace. This is the default.

(デフォルト値は次のとおりです All)

String
feature_dataset

Limits the feature classes returned to the feature dataset, if specified. If blank, only stand-alone feature classes will be returned in the workspace.

String

戻り値

データ タイプ説明
String

The list containing feature class names is returned from the function, limited by the optional wild_card, feature_type, and feature_dataset arguments.

コードのサンプル

ListFeatureClasses example

Copy shapefiles to a geodatabase.

import os
import arcpy

# Set the workspace for ListFeatureClasses
arcpy.env.workspace = "c:/base"

# Use the ListFeatureClasses function to return a list of
#  shapefiles.
featureclasses = arcpy.ListFeatureClasses()

# Copy shapefiles to a file geodatabase
for fc in featureclasses:
    arcpy.CopyFeatures_management(
        fc, os.path.join("c:/base/output.gdb",
                         os.path.splitext(fc)[0]))
ListFeatureClasses example 1

List all feature classes in a geodatabase, including any in feature datasets.

import arcpy
import os

arcpy.env.workspace = "c:/base/gdb.gdb"

datasets = arcpy.ListDatasets(feature_type='feature')
datasets = [''] + datasets if datasets is not None else []

for ds in datasets:
    for fc in arcpy.ListFeatureClasses(feature_dataset=ds):
        path = os.path.join(arcpy.env.workspace, ds, fc)
        print(path)

関連トピック

  • データのリストの作成
  • Walk

ArcGIS Desktop

  • ホーム
  • ドキュメント
  • サポート

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

Esri について

  • 会社概要
  • 採用情報
  • Esri ブログ
  • ユーザ カンファレンス
  • デベロッパ サミット
Esri
ご意見・ご感想をお寄せください。
Copyright © 2021 Esri. | プライバシー | リーガル