Getting started with arcpy.mapping resources

Discussion created by jbarrette-esristaff Employee on Sep 29, 2011
Latest reply on May 15, 2015 by jkt5y
Getting started with Python map automation (arcpy.mapping)

ArcGIS 10 provides a new Python mapping module (arcpy.mapping) that allows you to interact with the contents of map documents and layer files without necessarily needing to interactively open an ArcMap session.  The methods, properties and functions available in this new map scripting API enable you, for example, to automate changing data sources, modify layer properties, export and print maps, as well as automate the creation of thematic maps and map series.  Because the new mapping module is part of the ArcPy geoprocessing framework, scripts can be used within ArcGIS Desktop but also published to ArcGIS Server as geoprocessing services making it much easier to make mapping and printing capabilities available on the server.

The following links are resources that will help you learn more about arcpy.mapping as well as sample scripts available for download:

Help Resources

�?� A new "Introduction to arcpy.mapping" help topic is a great starting point.  It includes links to a new arcpy.mapping tutorial and general guidelines for working with arcpy.mapping.  ArcGIS Desktop help has a complete section dedicated to the ArcPy mapping module.  Embedded within the help topics are over 100 different, practical help samples that can be copied/pasted into your applications.  Be sure to review the "Best ways to get started" section.

�?� A video presentation called �??Python Scripting for Map Automation in ArcGIS 10�?� presented at the 2011 Developer�??s Summit is an excellent starting point.  This presentation not only introduces arcpy.mapping but also demonstrates many of its use cases.

�?� Another video presentation called "Arcpy.mapping: Export a map in PDF format from a web browser" that demonstrates how arcpy.mapping scripts can be published as geoprocessing services and published to web applications.

Sample Applications

�?� Approximately 20 script tools that perform routine map and layer management tasks, printing and exporting, as well as basic cartographic operations.  This is an excellent download because it includes many practical code samples that perform a variety of tasks and they are easy enough to modify for your own purposes.
�?� A script tool that combines Data Driven Pages, arcpy.mapping, and the ReportLab site package to generate a reference map book that includes street index pages.  It demonstrates how arcpy.mapping can be used to extend Data Driven Pages capabilities.
�?� A script that incorporates Data Driven Pages and arcpy.mapping to build a map series that includes dynamic graphic tables. There is a very complete README.doc file included with the download that also addresses other useful tips and tricks that go along with the application.

Web Courses

�?� Basics of Python (for ArcGIS 10).  This course teaches fundamental concepts you need to know to create Python scripts in ArcGIS. You will learn guidelines for proper Python syntax, techniques to troubleshoot common errors, and how to use loops to test for conditions and execute different code based on the result.

�?� Python Scripting for Map Automation in ArcGIS 10. This course teaches how to automate map production and related data management tasks that would be time-consuming and tedious to perform manually. You will learn how to work with the mapping module of the ArcPy site package to quickly and easily update map layers and map document properties, modify map content, and produce individual maps and map books.

Jeffrey Barrette | Product Engineer