Arcpy.Describe and arcpy.List*. Describing objects ArcGIS interacts with a number of types of...
-
date post
22-Dec-2015 -
Category
Documents
-
view
233 -
download
1
Transcript of Arcpy.Describe and arcpy.List*. Describing objects ArcGIS interacts with a number of types of...
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.
Overview
gp.Describe(object) Describe object
gp.List* Python list of objects
ArcGIS 9.3
ArcGIS 10arcpy.Describe(object)arcpy.List*
9.2 9.3
Evolution Describe Object Properties
An example of how Python is evolvingwith ArcGIS
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 notarcpy.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
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 thatis returned by Fields propertyof 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 folderIf 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 ExtensionsInterfacing with Windows, Windows applications & librariesExamples @ http://win32com.goermezer.de/content/category/7/87/189/
SWF To Image ActiveX libraryhttps://bytescout.com/download/download_freeware.html
21 of 22
os.walk() not-so-simple example