Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Cover
Table of Contents
Programming ArcGIS with Python Cookbook Second Edition
Programming ArcGIS with Python Cookbook Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
What you need for this book
Who this book is for
Sections
Conventions
Reader feedback
Customer support
1. Fundamentals of the Python Language for ArcGIS
Using the ArcGIS Python window
Python language fundamentals
Summary
2. Managing Map Documents and Layers
Referencing the current map document
Referencing map documents on a disk
Getting a list of layers in a map document
Restricting the list of layers
Zooming in to selected features
Changing the map extent
Adding layers to a map document
Inserting layers into a map document
Updating layer symbology
Updating layer properties
Working with time-enabled layers in a data frame
3. 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 broken data sources in all map documents in a folder
4. 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 the properties of layout elements
Getting a list of available printers
Printing maps with PrintMap()
Exporting a map to a PDF file
Exporting a map to an image file
Exporting a report
Building a map book with Data Driven Pages and ArcPy mapping
Publishing a map document to an ArcGIS Server service
5. 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
6. Creating Custom Geoprocessing Tools
Creating a custom geoprocessing tool
Creating a Python toolbox
7. Querying and Selecting Data
Constructing a 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
8. Using the ArcPy Data Access Module with Feature Classes and Tables
Retrieving features from a feature class with SearchCursor
Filtering records with a where clause
Improving cursor performance with geometry tokens
Inserting rows with InsertCursor
Updating rows with UpdateCursor
Deleting rows with UpdateCursor
Inserting and updating rows inside an edit session
Reading geometry from a feature class
Using Walk() to navigate directories
9. Listing and Describing GIS Data
Working with the ArcPy list functions
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 a raster image
10. Customizing the ArcGIS Interface with Add-ins
Downloading and installing the Python Add-in Wizard
Creating a button add-in and using the Python add-ins module
Installing and testing an add-in
Creating a tool add-in
11. Error Handling and Troubleshooting
Exploring the default Python error message
Adding Python exception handling structures (try/except/else)
Retrieving tool messages with GetMessages()
Filtering tool messages by the level of severity
Testing for and responding to specific error messages
12. Using Python for Advanced ArcGIS
Getting started with the ArcGIS REST API
Making HTTP requests and parsing the response with Python
Getting layer information with the ArcGIS REST API and Python
Exporting a map with the ArcGIS REST API and Python
Querying a map service with the ArcGIS REST API and Python
Geocoding with the Esri World Geocoding Service
Using FieldMap and FieldMappings
Using a ValueTable to provide multivalue input to a tool
13. Using Python with ArcGIS Pro
Using the new Python window in ArcGIS Pro
Coding differences between ArcGIS for Desktop and ArcGIS Pro
Installing Python for ArcGIS Pro
Converting ArcGIS for Desktop Python code to ArcGIS Pro
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 Python Recipes Every GIS Programmer Should Know
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 →