ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Ayuda
  • Sign Out
ArcGIS Desktop

ArcGIS Online

La plataforma de representación cartográfica para tu organización

ArcGIS Desktop

Un completo SIG profesional

ArcGIS Enterprise

SIG en tu empresa

ArcGIS for Developers

Herramientas para crear aplicaciones basadas en la ubicación

ArcGIS Solutions

Plantillas de aplicaciones y mapas gratuitas para tu sector

ArcGIS Marketplace

Obtén aplicaciones y datos para tu organización.

  • Documentación
  • Soporte
Esri
  • Iniciar sesión
user
  • Mi perfil
  • Cerrar sesión

ArcMap

  • Inicio
  • Introducción
  • Cartografiar
  • Analizar
  • Administrar datos
  • Herramientas
  • Extensiones

ListFields

  • Resumen
  • Sintaxis
  • Muestra de código

Resumen

Lists the 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.

Sintaxis

ListFields (dataset, {wild_card}, {field_type})
ParámetroExplicaciónTipo de datos
dataset

The specified feature class or table whose fields will be returned.

String
wild_card

The wild_card limits the results returned. If no wild_card is specified, all values are returned.

(El valor predeterminado es None)

String
field_type

The specified field type to be returned. Valid field types are:

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

(El valor predeterminado es All)

String

Valor de retorno

Tipo de datosExplicación
Field

A list containing Field objects is returned.

Muestra de código

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)]

Temas relacionados

  • Crear listas de datos
  • Utilizar campos e índices
  • Field

ArcGIS Desktop

  • Inicio
  • Documentación
  • Soporte

Plataforma ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

Acerca de Esri

  • Quiénes somos
  • Empleo
  • Blog de Esri
  • Conferencia de usuarios
  • Cumbre de desarrolladores
Esri
Díganos su opinión.
Copyright © 2019 Esri. | Privacidad | Legal