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

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

ListFields

  • 概要
  • 構文
  • コードのサンプル

概要

Returns a list of fields in a feature class, shapefile, or table in a specified dataset. The returned list can be limited with search criteria for name and field type and will contain field objects.

構文

ListFields (dataset, {wild_card}, {field_type})
パラメーター説明データ タイプ
dataset

The specified feature class or table with the fields to be returned.

String
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.

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

String
field_type

The specified field type to be returned. The following are valid field types::

  • All — All field types are returned. This is the default.
  • BLOB —Only field types of BLOB are returned.
  • Date —Only field types of Date are returned.
  • Double —Only field types of Double are returned.
  • Geometry —Only field types of Geometry are returned.
  • GlobalID —Only field types of GlobalID are returned.
  • GUID —Only field types of GUID are returned.
  • Integer —Only field types of Integer are returned.
  • OID —Only field types of OID are returned.
  • Raster —Only field types of Raster are returned.
  • Single —Only field types of Single are returned.
  • SmallInteger —Only field types of SmallInteger are returned.
  • String —Only field types of String are returned.

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

String

戻り値

データ タイプ説明
Field

A list containing Field objects is returned.

コードのサンプル

ListFields example

List field properties.

import arcpy

# For each field in the Hospitals feature class, print
#  the field name, type, and length.
fields = arcpy.ListFields("c:/data/municipal.gdb/hospitals")

for field in fields:
    print("{0} is a type of {1} with a length of {2}"
          .format(field.name, field.type, field.length))
ListFields example 2

Generate a list of field names.

import arcpy

featureclass = "c:/data/municipal.gdb/hospitals"
field_names = [f.name for f in arcpy.ListFields(featureclass)]

関連トピック

  • データのリストの作成
  • フィールドおよびインデックスの使用
  • Field

ArcGIS Desktop

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

ArcGIS

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

Esri について

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