Book Image

Programming ArcGIS with Python Cookbook, Second Edition

By : Donald Eric Pimpler, Eric Pimpler
Book Image

Programming ArcGIS with Python Cookbook, Second Edition

By: Donald Eric Pimpler, Eric Pimpler

Overview of this book

Table of Contents (22 chapters)
Programming ArcGIS with Python Cookbook Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Referencing map documents on a disk


In addition to being able to reference the currently active map document file in ArcMap, you can also access map document files that are stored on a local or remote drive by using the MapDocument() constructor. In this recipe, you'll learn how to access these map documents.

Getting ready

As I mentioned earlier, you can also reference a map document file that resides somewhere on your computer or a shared server. This is done simply by providing a path to the file. This is a more versatile way of obtaining a reference to a map document because it can be run outside the ArcGIS Python window. Later, when we will discuss parameters in a script, you'll understand that you can make this path a parameter so that the script is even more versatile, with the ability to input a new path each time it is needed.

How to do it…

Follow these steps to learn how to access a map document stored on a local or remote drive:

  1. Open the IDLE development environment from Start | All...