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

Fixing broken data sources with MapDocument.replaceWorkspaces()


During the course of normal GIS operations, it is a fairly common practice to migrate data from one file type to another. For example, many organizations migrate data from older personal geodatabase formats to the new file geodatabase types, or perhaps even enterprise ArcSDE geodatabases. You can automate the process of updating your datasets to a different format with MapDocument.replaceWorkspaces().

Getting ready

MapDocument.replaceWorkspaces() is similar to MapDocument.findAndReplaceWorkspacePaths(), but it also allows you to switch from one workspace type to another. For example, you can switch from a file geodatabase to a personal geodatabase. However, it only works in one workspace at a time. In this recipe, we'll use MapDocument.replaceWorkspaces() to switch our data source from a file geodatabase to a personal geodatabase.

How to do it…

Follow these steps to learn how to fix broken data sources using MapDocument.replaceWorkspaces...