Tag: Layout

Pro 1.1: Why Do I Need to Click “Download?”

Pictometry 3D Scene

On Friday, July 17th, many ArcGIS Pro users saw a small window pop up on their computer screen. It announced to them, and to the world that a new version of Pro is available to download. I often find myself … Continue reading

Posted in ArcGIS Pro, Uncategorized | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , | Leave a comment

Range Card Template is available for download

The new Range Card template for ArcGIS 10.1 (prerelease) is available for download from Arcgis.com.

Sample Range Card

This Esri Defense template simplifies the process of creating a set of range cards for a position. The template allows you to create range fans based on weapon characteristics and placement, and then lets you generate a set of standard range cards for each weapon at the position.  The template includes a variety of point features to represent reference points, target reference points, trees, and structures.  It also includes line features to represent limit lines, walls, fences, and ditches, and area features to represent range fans.The template tools create index features for each range fan feature, and the ArcGIS Data Driven Pages tool automates the production of layouts for each range card. 

The downloadable map package contains a finished example map, a starter map with an empty set of feature templates, and geoprocessing tools to build range fans and construct the index features for data driven pages.
Posted in Defense | Tagged , , , , , , | Leave a comment

Taking full advantage of dynamic text

At 10 we released dynamic text for the layout. This is layout text that updates automatically based on a property from the map, a data frame, or the computer system.  Additionally, if you are using data driven pages, dynamic text can be used for page names, page numbers, or attributes from the index layer.  Dynamic text uses tags in a standard text element string to specify the properties to return. You can use dynamic text to display things like the current date and time, the current user logged in to the computer, or the map author. The most common dynamic text tags can be added using the Insert > Dynamic Text menu.  However, this is only a small number of the types and formats that can be used.

A dynamic text tag always includes a type, for example <dyn type =”document”/> is how you access properties of the map document and <dyn type =”page”/> is used to access properties of data driven pages.  There are seven types available. In addition to document and page are computer, user, date, time, and data frame. For each type there are additional properties or formatting options. You can specify these using the key words property and format.  For example,  <dyn type=”document” property=”credits”/> will return the credits stored in the map document properties, and <dyn type=”date” format=”dddd MMM yyyy”/> will return Thursday Sep 2010.

When working with data driven pages you can return the value of any attribute in your page index layer. Simply specify the dynamic type as page and the property as the attribute. For example, <dyn type =”page” property=”POP_2000”/> will return the population value of the POP_2000 attribute for the current page. 

There are other things you can do with dynamic text. For example, you can add the corner coordinates of your data frame to your layout.  Using the data frame type and the properties for upper left, upper right, lower left and lower right you can access the coordinates of each corner.  For example, <dyn type=”dataFrame” name=”DataFrameName” property=”upperLeft.x” units=”dms” decimalPlaces=”2″/> will return the x coordinate in degrees minutes seconds for the upper left corner of your data frame and <dyn type=”dataFrame” name=”DataFrameName” property=”upperLeft.y” units=”dms” decimalPlaces=”2″/> will return the y coordinate. If you pan and zoom, the coordinate will update dynamically with the changes to position.


There are a few special tags for handling null values or empty strings, and for specifying strings that appear either before or after the dynamic text.  These key words are emptyStr, postStr, and preStr. The preStr option allows you to add text before a dynamic text string and the postStr option allows you to add text after a dynamic text string. The emptyStr option lets you specify a string to substitute when the dynamic text returns a null value. For example, when the map author property is not populated, you could use the following: <dyn type=”document” property=”author” emptyStr=”Map author unknown.”/> to return a more descriptive explanation rather than just leaving a blank.  Or in some cases you may want the entire string to disappear. For example, if you are using dynamic text to label adjoining pages in your map book, when you don’t have an adjoining page you may want the entire “See page: “ text to disappear.  <dyn type=”page” property=”PageNumber_N” preStr=”See Page: ” emptyStr = ” “/> will hide the entire “See Page: “ string when the PageNumber_N attribute is empty.


There are many types and formats for dynamic text that are available in addition to those under the Insert > Dynamic Text menu.  These are all accessible through tags that can be added to any layout text element.  For a more complete list, and to start taking full advantage of all the dynamic text options, take a look through the tables and examples in the help doc Working with dynamic text located here.

Content from David Watkins

Posted in Mapping | Tagged , , , , , | 6 Comments

Combining Data Driven Pages with Python and arcpy.mapping

You can use arcpy.mapping, the Python module that allows you to interact with your map documents and layers, in conjunction with your data driven pages to do much more than make simple map books. For example, most complete map book products require title pages, overview maps, and sometimes pages of text or report information. In the past, putting these types of map books together could be time consuming, and usually required extra steps to assemble pages into a single document. At ArcGIS 10 putting together this type of map book product can be automated with a simple Python script.  

The following example exports a title page, an overview map, and a series of data driven pages and combines them, along with a PDF file containing a list of contact information, into a single multi-page PDF file:

import arcpy, os, string
#Create final output PDF file
finalPdf = arcpy.mapping.PDFDocumentCreate(r”C:MyProjectMyAtlas.pdf”)

#Export Title page and append to final PDF file
mxd = arcpy.mapping.MapDocument(r”C:MyProjectMyTitlePage.mxd”)
tmpPdf = r”C:MyProjectMyTitlePage.pdf”
arcpy.mapping.ExportToPDF(mxd, tmpPdf)
del mxd, tmpPdf
#Export Overview Map and append to final PDF file    
mxd = arcpy.mapping.MapDocument(r”C:MyProjectMyOverviewMap.mxd”)
tmpPdf = r”C:MyProjectMyOverviewMap.pdf”
arcpy.mapping.ExportToPDF(mxd, tmpPdf)
del mxd, tmpPdf

#Export Data Driven Pages and append to final PDF file    
mxd = arcpy.mapping.MapDocument(r”C:MyProjectMyAtlasPages.mxd”)
tmpPdf = r”C:MyProjectMyAtlasPages.pdf”
ddp = mxd.dataDrivenPages
ddp.exportToPDF(tmpPdf, “ALL”)
del mxd, tmpPdf

#Append Contact Information to final PDF file

#Update the properties of the final pdf to show thumbnail view

del finalPdf

You can also use python in conjunction with data driven pages to cycle through each page, and perform one of the many operations supported by arcpy.mapping. For example, you can update a layer’s symbology, update some layout text, and export or print each map. This example demonstrates how to cycle through all your data driven pages and export them as PNG files:
import arcpy

#Specify the map document
mxd = arcpy.mapping.MapDocument(r”C:MyProjectMyAtlasPages.mxd”)

#Export each of the data driven pages
for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):
    mxd.dataDrivenPages.currentPageID = pageNum
    print “Exporting page {0} of {1}”.format(str(mxd.dataDrivenPages.currentPageID), str(mxd.dataDrivenPages.pageCount))
    arcpy.mapping.ExportToPNG(mxd, r”C:MyProjectOutputMyAtlas_Page” + str(pageNum) + “.png”)
del mxd

See the following blog entry for more info on exporting and printing using arcpy.mapping: http://blogs.esri.com/Dev/blogs/arcgisdesktop/archive/2010/02/01/ArcPy-and-Geoprocessing_2620_-it_1920_s-for-Developers-too.aspx

arcpy.mapping opens up many possibilities for the types of map books you can create. For example, you can create a thematic atlas with multiple pages specifying a different theme on each page. The following example zooms to a selected parcel, toggles on different layer visibility and exports the layout for multiple themes in order to create a parcel report with a soil map, a flood map and a zoning map:

import arcpy, os

#Specify output path and final output PDF
outPath = r”C:MyProjectoutput\”
finalPdf = arcpy.mapping.PDFDocumentCreate(outPath + “ParcelReport.pdf”)

#Specify the map document and the data frame
mxd = arcpy.mapping.MapDocument(r”C:MyProjectMyParcelMap.mxd”)
df = arcpy.mapping.ListDataFrames(mxd, “Layers”)[0]

#Select a parcel using the LocAddress attribute and zoom to selected
parcelLayer = arcpy.mapping.ListLayers(mxd, “Parcels”, df)[0]
arcpy.SelectLayerByAttribute_management(parcelLayer, “NEW_SELECTION”, “”LocAddress” = ’519 Main St’”)

#Turn on visibility for each theme and export the page
lyrList = ["Soils", "Floodplains", "Zones"]
for lyrName in lyrList:
     lyr = arcpy.mapping.ListLayers(mxd, lyrName, df)[0]
     lyr.visible = True

     #Export each theme to a temporary PDF and append to the final PDF
     tmpPdf = outPath + lyrName + “_temp.pdf”
     if os.path.exists(tmpPdf):
     arcpy.mapping.ExportToPDF(mxd, tmpPdf)
     #Turn off layer visibility and clean up for next pass through the loop
     lyr.visible = False
     del lyr, tmpPdf
del mxd, df, finalPdf

Frequently map books require a separate layout for a left and right page in order to create a wider margin in the middle when the pages are bound together. Or some map books require page layouts using different orientations, where some of the maps are portrait and some are landscape.   In this example we use two layouts, one for the left and one for the right. Both layouts have multiple pages created using data driven pages. The following script exports all the left pages and all the right pages and assembles them together into a single PDF file:

import arcpy, os

# Specify left and right map documents and create final output PDF file
mxdLeft = arcpy.mapping.MapDocument(r”C:MyProjectMyAtlas_left.mxd”)
mxdRight = arcpy.mapping.MapDocument(r”C:MyProjectMyAtlas_right.mxd”)
finalPdf = arcpy.mapping.PDFDocumentCreate(r”C:MyProjectMyAtlas.pdf”)

#Export left (odd) pages to temporary PDF files
for pgNumLeft in range(1, mxdLeft.dataDrivenPages.pageCount + 1, 2):
    mxdLeft.dataDrivenPages.currentPageID = pgNumLeft
    arcpy.mapping.ExportToPDF(mxdLeft, r”C:MyProjectTemp_Page” + str(pgNumLeft) + “.pdf”)

#Export right (even) pages to temporary PDF files
for pgNumRight in range(2, mxdRight.dataDrivenPages.pageCount + 1, 2):
    mxdRight.dataDrivenPages.currentPageID = pgNumRight
    arcpy.mapping.ExportToPDF(mxdRight, r”C:DataDemosHamiltonCoDemooutputAtlas_Page” + str(pgNumRight) + “.pdf”)

#Append all pages into final PDF file and clean up temporary PDF files
for pgNum in range(1, mxdLeft.dataDrivenPages.pageCount + 1,):
    tmpPdf = r”C:DataDemosHamiltonCoDemooutputAtlas_Page” + str(pgNum) + “.pdf”
    if os.path.exists(tmpPdf):
         finalPdf.appendPages (tmpPdf)
del mxdLeft, mxdRight, finalPdf, tmpPdf

When you combine the multiple pages, and dynamic layout elements from data driven pages along with the things you can do with arcpy.mapping there are many possibilities. Arcpy.mapping makes it easy to write powerful Python scripts that automate many of the redundant map book and atlas compilation and production tasks.

These are just a small sample.  There is a lot more you can do with arcpy.mapping.  See an overview at:

You can find additional sample scripts at Code Gallery


Posted in Uncategorized | Tagged , , , , , , , | 7 Comments

Creating Place Name Indexes for Map Books

ArcGIS 10 includes the ability to make multiple-page map books using data driven pages. However, map books are often a collection of information in addition to the maps, for example, title pages, tables of contents, and index pages.  So, in addition to data driven pages, ArcGIS 10 includes the arcpy.mapping Python module that provides the ability to create and combine a series of pages into a final map book product.  

Building an index or gazetteer of place names is a common requirement for map books, and data driven pages by themselves do not provide a solution for building the index pages. However, Python scripting can be used to create these. We have placed a sample on the Resource Center to help. The sample combines the use of Data Driven Pages, arcpy.mapping, and a 3rd party PDF design toolkit called ReportLab to create a final map book product with index pages.


Indexes can vary greatly from organization to organization. The rules for what is indexed, how the index table is compiled, and the index formats can differ widely.  This sample provides one example. However, both the geoprocessing workflow and script can be customized for your particular index needs (Note:  In the geoprocessing steps in this example the Frequency tool is used that requires an ArcInfo license.).  Also, one of the nice things about using ReportLab is it gives you all sorts of formatting options for the results.  The arcpy.mapping Map Book with Index Pages sample can be downloaded here.

Content provided by David W.

Posted in Uncategorized | Tagged , , , , , , , , | 2 Comments

Map Books

With ArcGIS 10 we’ve included support for map books with a combination of new data driven pages functionality and the arcpy.mapping Python scripting module.  Data driven pages use the same concepts as the map book developer sample with an easy to use implementation at the ArcView license level.  A supported map book application within ArcMap will be a change for those of you who have used the developer sample DSMapBook to create your multi-page map products in the past.

Data driven pages use an index layer to define page extents, just like the index layer used in the map book developer sample. We have made many enhancements throughout ArcMap to support map books. For example, both the print and export dialogs include options for multiple pages when data driven pages are enabled, and we’ve added dynamic text including page name, page number, date/time, and many of the map and data frame properties. Additional functionality also includes the ability to set up locator maps specific to your pages with new options for data frame extent, page definition queries and clip to shape. Geoprocessing tools are provided to help set up an index layer in a new Data Driven Pages toolset. They include tools for generating a standard grid index or a strip map index that follows a linear feature.

In addition to data driven pages we are providing a new Python module for working with your map documents and map books called arcpy.mapping.  This module provides a means to automate more complex map book scenarios.  For example, most complete map book products require title pages, overview maps, and sometimes pages of text or report information. In the past, putting these types of map books together could be time consuming, usually requiring manual assembly using a third party software package.  At ArcGIS 10 putting together this type of map book product can be fully automated with a simple Python script.  Many other workflows can be supported using arcpy.mapping, for example, you can cycle through all your data driven pages, update a layer’s symbology, update some layout text, and export or print each map.  Arcpy.mapping opens many possibilities for the types of map books you can create, for example, a thematic atlas with multiple pages specifying a different theme on each page, or a map book with a separate layout for the left and right page, exported and assembled into a single multi-page PDF file.

Posted in Uncategorized | Tagged , , , , | Leave a comment

Using Python in ArcGIS 10 – Live Training

More live virtual training on ArcGIS 10 this Thursday  May 13th 2010

Live Training Seminars run approximately 60 minutes and are broadcast live from ESRI in Redlands, California. The seminars are free and there is no registration—attendance is on a first-come, first-served basis.

This seminar will introduce Python scripting and show how you can automate common GIS tasks and analyses to help increase productivity and the quality of your maps and data. You will also learn how Python scripts are more integrated with ArcGIS 10 allowing you to create simple or complex workflows quickly and easily.

Using Python in ArcGIS 10
Thursday, May 13, 2010
9:00 a.m., 11:00 a.m., & 3:00 p.m. Pacific Time (US & Canada)
12:00 p.m., 2:00 p.m., & 6:00 p.m. Eastern Time (US & Canada)
4:00 p.m., 6:00 p.m., & 10:00 p.m. UTC/GMT


Posted in Uncategorized | Tagged , , , , , , , , , , , , | Leave a comment

Creating dynamic locator maps and adding page effects to your data driven pages

There are some great enhancements in ArcGIS 10 that work in conjunction with data driven pages and make it possible to create dynamic locator maps and add some interesting page effects to your map books.

A new data frame extent option, Other Data Frame, has been added that makes it possible to synchronize the extent of your main data frame with the extent of one or more additional data frames. If you pan and zoom in the main data frame it will automatically pan and zoom in the additional data frames. This can be useful if you have two themes you want to show side by side and keep the same extent in both data frames, and you can use this new extent option to create dynamic locator maps. Locator maps show a larger area than focus map, and often highlight the focus area giving the map reader a better reference to the maps location. The Other Data Frame extent option allows you to specify a margin that makes it possible to define a larger area, while at the same time having the locator map pan and zoom using the extent of the main map. You can also zoom to features that intersect the extent of the main map. For example, if you are making a County Atlas of the United States, you can add a locator map that updates its extent to the state that includes the current county. For example, if you are San Diego County, California then the locator map will zoom to California, and when you move to Travis County, Texas the locator map will automatically zoom to Texas.  To learn more about the new map extent options see the Desktop help.

There are also some additional ways to highlight the main map in your locator map. If you are using data driven pages you can highlight the extent using the shape of the index feature. This is the new default when using an Extent Indicator. This used to be the Extent Rectangle, but this new functionality means you can use any feature shape, so the rectangle part didn’t make sense any more, but you can still use the extent rectangle by selecting the “Use simple extent” option.  Since you can use the shape of the data driven page index feature, you can do more than just outline the extent, you can give the entire shape a different color by going into the frame properties and defining a background color.  To learn more about extent indicators see the help topic.

There are other enhancements that make it possible to add some new page effects to highlight the current data driven page. Clip to Shape has a new option to use the data driven page index feature’s shape and another new option to allow you to exclude individual layers from clipping. This makes it possible to only clip the layers you want, while allowing other layers extend to the edge of the data frame. This means no more empty white space around your Clip to Shape extent, and it also makes it possible to highlight the current page by displaying the index feature area in a different color. To learn more about the new Clip to Shape options see the help topic.

There is also a new Page Definition Query that can be added to your Definition Queries when working with data driven pages.  The page definition lets you filter features that have attributes that either match, or don’t match the name of your data driven page index feature. This makes it possible to include features, or not include features, based on the current page. For example, many atlases require an overlap area between pages and unique annotation is required for each page where the text has been moved to avoid being clipped at the edges. By attributing the annotation with the associated page name, you can use a Page Definition Query to only show the annotation that belongs to the current page. To learn more about page definition queries see the help topic.

Content provided by David Watkins

See recent post on Data Driven Pages

Posted in Uncategorized | Tagged , , , , | Leave a comment