-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Programming ArcGIS with Python Cookbook, Second Edition
By :
Feature classes and tables contain one or more columns of attribute information. You can get a list of the fields in a feature class through the ListFields() function.
The ListFields() function returns a list containing individual Field objects for each field in a feature class or table. Some functions, such as ListFields() and ListIndexes(), require an input dataset to operate on. You can use a wildcard or field type to constrain the list that is returned. Each Field object contains various read-only properties including Name, AliasName, Type, Length, and others.
Follow these steps to learn how to return a list of fields in a feature class.
Open IDLE and create a new script window.
Save the script as C:\ArcpyBook\Ch9\ListOfFields.py.
Import the arcpy module:
import arcpy
Set the workspace:
arcpy.env.workspace = "C:/ArcpyBook/data/CityOfSanAntonio.gdb"
Call the ListFields() method on the Burglary feature class inside a...
Change the font size
Change margin width
Change background colour