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

Working with time-enabled layers in a data frame


In this recipe, you will learn how to time-enable a layer and data frame. You will then write a script that cycles through the time range for the layer and exports a PDF map showing crimes through time in seven-day intervals.

Getting ready

The DataFrameTime object provides access to time management operations for time-enabled layers in a data frame. This object is returned when you reference the DataFrame.time property, and includes properties for retrieving the current time, end time, start time, time step interval, and others that are established by using the Time Slider Options dialog box and then saved with the map document. One or more layers in a data frame must be time-enabled for this functionality to be operational.

How to do it...

Follow these steps to learn how to work with time-enabled layers:

  1. Open c:\ArcpyBook\Ch2\Crime_Ch2.mxd with ArcMap.

  2. In the ArcMap Table Of Contents make sure Crime is the active data frame.

  3. Open the Layer Properties...