arcpy.Describe and arcpy.List*
Describing objects ArcGIS interacts with a number of types of objects arcpy.Describe(object) exposes object properties that can be used in Python to control program flow, tool parameter values, etc. of geoprocessing scripts e.g. Clip all polyline feature classes in a workspace.
gp.List* Python list of objects ArcGIS 10 Overview gp.Describe(object) Describe object gp.List* Python list of objects ArcGIS 10 arcpy.Describe(object) arcpy.List*
Evolution Describe Object Properties An example of how Python is evolving with ArcGIS 9.2 9.3
Describing data in 10.x
Describe Example (feature class) … if you plan to do multiples in same workspace
Describe a Feature Class
Describe a Geodatabase some are case sensitive, others not arcpy.env.workspace is
Fields in a Feature Class via Describe ArcGIS 8.x, 9.x ArcGIS 10
Describe a Raster
List functions Scripts allow you to iterate through lists arcpy provides many list functions that create lists of objects e.g. For each feature class in a given workspace, create a report that shows how many are point, line, and polygon (uses ListFeatureClasses and Describe)
Lists of Objects in Geoprocessing OMD
List*: Python List (i.e. returns a Python List) Listing Data List*: Python List (i.e. returns a Python List) Know number of * in a Python list Use a for loop
ListFeatureClasses([wildCard], [FeatureType])
ListFeatureClasses examples
ListFields(pInputValue, [wild card], [FieldType]) Same Field object as each Field object in list that is returned by Fields property of the Describe Object
ListFields examples
os.walk(top, topdown=True, onerror=None, followlinks=False)
os.walk() simple example
os.walk() not-so-simple example Find all Flash videos (SWF) in the entire tree under a given root folder If the SWF file has the “slide”, and not “group”, as part of its name convert the first frame of the video to a JPG with the name of the SWF
Dependencies Python for Windows Extensions Interfacing with Windows, Windows applications & libraries Examples @ http://win32com.goermezer.de/content/category/7/87/189/ SWF To Image ActiveX library https://bytescout.com/download/download_freeware.html
os.walk() not-so-simple example