ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Aide
  • Sign Out
ArcGIS Desktop

ArcGIS Online

La plateforme cartographique de votre organisation

ArcGIS Desktop

Un SIG professionnel complet

ArcGIS Enterprise

SIG dans votre entreprise

ArcGIS Developers

Outils de création d'applications de localisation

ArcGIS Solutions

Modèles d'applications et de cartes gratuits pour votre secteur d'activité

ArcGIS Marketplace

Téléchargez des applications et des données pour votre organisation.

  • Documentation
  • Support
Esri
  • Se connecter
user
  • Mon profil
  • Déconnexion

ArcMap

  • Accueil
  • Commencer
  • Carte
  • Analyser
  • Gérer les données
  • Outils
  • Extensions

FieldInfo

  • Résumé
  • Syntaxe
  • Propriétés
  • Vue d’ensemble des méthodes
  • Méthodes
  • Exemple de code

Résumé

Provides field info methods and properties for layer and table views.

Syntaxe

 FieldInfo  ()

Propriétés

PropriétéExplicationType de données
count
(Lecture seule)

The field count.

Integer

Vue d’ensemble des méthodes

MéthodeExplication
addField (field_name, new_field_name, visible, split_rule)

Adds a field info entry

exportToString ()

Exports the object to its string representation.

findFieldByName (field_name)

Finds the field index by field name

findFieldByNewName (field_name)

Finds the field index by new field name.

getFieldName (index)

Gets the field name from the table by index position.

getNewName (index)

Returns the new field name from the table by index position.

getSplitRule (index)

Gets the split rule from the table by index position.

getVisible (index)

Returns the visible flag from the table by index position.

loadFromString (string)

Restore the object using its string representation. The exportToString method can be used to create a string representation.

removeField (index)

Removes a FieldInfo entry from a table.

setFieldName (index, field_name)

Sets the field name into the table.

setNewName (index, new_field_name)

Sets the new field name into the table.

setSplitRule (index, rule)

Sets the split rule into the table.

setVisible (index, visible)

Set the visible flag of a field on the table.

Méthodes

addField (field_name, new_field_name, visible, split_rule)
ParamètreExplicationType de données
field_name

The field name from the input feature class or table.

String
new_field_name

Sets the field name for the new layer or table view.

String
visible

Sets whether the field is visible or hidden.

  • VISIBLE —Field is visible.
  • HIDDEN —Field is hidden.
String
split_rule

Sets the behavior of an attribute's values when a feature is split.

  • NONE —The attributes of the two resulting features take on a copy of the original value.
  • RATIO —The attributes of resulting features are a ratio of the original feature's value. The ratio is based on the division of the original geometry. If the geometry is divided equally, each new feature's attribute gets one-half of the value of the original object's attribute.
String
exportToString ()

Valeur renvoyée

Type de donnéesExplication
String

The string representation of the object.

findFieldByName (field_name)
ParamètreExplicationType de données
field_name

The field name used to find its index position

String

Valeur renvoyée

Type de donnéesExplication
Integer

The index position

findFieldByNewName (field_name)
ParamètreExplicationType de données
field_name

The new field name used to find its index position.

String

Valeur renvoyée

Type de donnéesExplication
Integer

The index position.

getFieldName (index)
ParamètreExplicationType de données
index

The index position.

Integer

Valeur renvoyée

Type de donnéesExplication
String

The field name.

getNewName (index)
ParamètreExplicationType de données
index

The index position.

Integer

Valeur renvoyée

Type de donnéesExplication
String

The new field name.

getSplitRule (index)
ParamètreExplicationType de données
index

The index position.

String

Valeur renvoyée

Type de donnéesExplication
String

The split rule.

  • NONE —The attributes of the two resulting features take on a copy of the original value.
  • RATIO —The attributes of resulting features are a ratio of the original feature's value. The ratio is based on the division of the original geometry. If the geometry is divided equally, each new feature's attribute gets one-half of the value of the original object's attribute.
getVisible (index)
ParamètreExplicationType de données
index

The index position.

String

Valeur renvoyée

Type de donnéesExplication
String

The visible flag.

  • VISIBLE —Field is visible.
  • HIDDEN —Field is hidden.
loadFromString (string)
ParamètreExplicationType de données
string

The string representation of the object.

String
removeField (index)
ParamètreExplicationType de données
index

The index position of the FieldInfo object.

Integer
setFieldName (index, field_name)
ParamètreExplicationType de données
index

The index position.

Integer
field_name

The field name to set into the table.

String
setNewName (index, new_field_name)
ParamètreExplicationType de données
index

The index position.

None
new_field_name

The new field name to set into the table.

String
setSplitRule (index, rule)
ParamètreExplicationType de données
index

The index position.

Integer
rule

The split rule to set into the table.

  • NONE —The attributes of the two resulting features take on a copy of the original value.
  • RATIO —The attributes of resulting features are a ratio of the original feature's value. The ratio is based on the division of the original geometry. If the geometry is divided equally, each new feature's attribute gets one-half of the value of the original object's attribute.
String
setVisible (index, visible)
ParamètreExplicationType de données
index

The index position.

Integer
visible

The visible policy to set into the table.

  • VISIBLE —Field is visible.
  • HIDDEN —Field is hidden.
String

Exemple de code

FieldInfo example

Display FieldInfo properties for a feature layer.

import arcpy

feature_class = "c:/Data/wells.shp"
layer = "temp_layer"
arcpy.MakeFeatureLayer_management(feature_class, layer)

# Create a describe object
desc = arcpy.Describe(layer)

# If a feature layer, continue
if desc.dataType == "FeatureLayer":

    # Create a fieldinfo object
    field_info = desc.fieldInfo

    # Use the count property to iterate through all the fields
    for index in range(0, field_info.count):
        # Print fieldinfo properties
        print("Field Name: {0}".format(field_info.getFieldName(index)))
        print("\tNew Name:   {0}".format(field_info.getNewName(index)))
        print("\tSplit Rule: {0}".format(field_info.getSplitRule(index)))
        print("\tVisible:    {0}".format(field_info.getVisible(index)))

Rubriques connexes

  • TableView properties
  • Layer properties

ArcGIS Desktop

  • Accueil
  • Documentation
  • Support

ArcGIS

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

A propos d'Esri

  • A propos de la société
  • Carrières
  • Blog d’Esri
  • Conférence des utilisateurs
  • Sommet des développeurs
Esri
Donnez-nous votre avis.
Copyright © 2021 Esri. | Confidentialité | Légal