Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Cover
Table of Contents
Programming ArcGIS 10.1 with Python Cookbook
Programming ArcGIS 10.1 with Python Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
1. Fundamentals of the Python Language for ArcGIS
Python language fundamentals
Summary
2. Writing Basic Geoprocessing Scripts with ArcPy
Using the ArcGIS Python window
Accessing ArcPy with Python
Executing tools from a script
Using ArcGIS Desktop help
Using variables to store data
Accessing ArcPy modules with Python
3. Managing Map Documents and Layers
Referencing the current map document
Referencing map documents on a disk
Accessing a data frame
Getting a list of layers in a map document
Restricting the list of layers
Changing the map extent
Getting a list of tables
Adding layers to a map document
Inserting layers into a map document
Updating layer symbology
Updating layer properties
4. Finding and Fixing Broken Data Links
Finding broken data sources in your map document and layer files
Fixing broken data sources with MapDocument.findAndReplaceWorkspacePaths()
Fixing broken data sources with MapDocument.replaceWorkspaces()
Fixing individual Layer and Table objects with replaceDataSource()
Finding all broken data sources in all map documents in a folder
5. Automating Map Production and Printing
Creating a list of layout elements
Assigning a unique name to layout elements
Restricting the layout elements returned by ListLayoutElements()
Updating layout element properties
Getting a list of available printers
Printing maps with PrintMap()
Exporting a map to a PDF file
Exporting a map to an image file
Creating a map book with PDFDocumentCreate() and PDFDocumentOpen()
6. Executing Geoprocessing Tools from Scripts
Finding geoprocessing tools
Retrieving a toolbox alias
Executing geoprocessing tools from a script
Using the output of a tool as an input to another tool
Setting environment variables and examining tool messages
7. Creating Custom Geoprocessing Tools
Creating a custom geoprocessing tool
8. Querying and Selecting Data
Constructing proper attribute query syntax
Creating feature layers and table views
Selecting features and rows with the Select Layer by Attribute tool
Selecting features with the Select by Location tool
Combining a spatial and attribute query with the Select by Location tool
9. Using the ArcPy Data Access Module to Select, Insert, and Update Geographic Data and Tables
Retrieving features from a feature class with a SearchCursor
Filtering records with a where clause
Improving cursor performance with geometry tokens
Inserting rows with InsertCursor
Updating rows with an UpdateCursor
Deleting rows with an UpdateCursor
Inserting and updating rows inside an edit session
Reading geometry from a feature class
10. Listing and Describing GIS Data
Getting a list of feature classes in a workspace
Restricting the list of feature classes returned with a wildcard
Restricting the list of feature classes returned with a feature type.
Getting a list of fields in a feature class or table
Using the Describe() function to return descriptive information about a feature class
Using the Describe() function to return descriptive information about an image
Returning workspace information with the Describe() function
11. Customizing the ArcGIS Interface with Add-Ins
Downloading and installing the Python Add-In wizard
Creating a button add-in
Installing and testing an add-in
Creating a tool add-in
12. Error Handling and Troubleshooting
Exploring the default Python error message
Adding Python exception handling structures (try/except/finally)
Retrieving tool messages with GetMessages()
Filtering tool messages by severity level
Testing for and responding to specific error messages
Returning individual messages with GetMessage()
A. Automating Python Scripts
Running Python scripts from the command line
Using sys.argv[ ] to capture command-line input
Adding Python scripts to batch files
Scheduling batch files to run at prescribed times
B. Five Things Every GIS Programmer Should Know How to Do with Python
Reading data from a delimited text file
Sending e-mails
Retrieving files from an FTP server
Creating ZIP files
Reading XML files
Index
← Prev
Back
Next →
← Prev
Back
Next →