What's new for automating map workflows in ArcGIS 10.1
Map automation with Python and arcpy.mapping
There were significant additions to arcpy.mapping for the 10.1 release, including:
- Symbology properties for the following renderers can now be automated: graduated colors, graduated symbols, unique values, and classified rasters.
- An Export Report function is available that allows you to automate the generation of reports.
- ArcGIS 10.1 provides access to a layer's time properties to perform analysis over time. You can also enable time on layers.
- The arcpy.mapping module now allows you to update the individual legend item styles in a Legend Element on a page layout by using the UpdateItem method. You can also remove legend items using the RemoveItem method.
- Two new functions exist to automate the map service publishing in a Python script. The CreateMapSDDraft function has been introduced to create draft service definition files. Secondly, the AnalyzeForSD function has been added to analyze service definition drafts for errors that might prevent publishing.
- ArcGIS provides support for printing WebMaps from the ArcGIS web APIs. The ConvertWebMapToMapDocument function will convert a WebMap that you intend to print or export to a map document. Once the document is converted, the full state of the WebMap exists in the map document.
- Text elements and graphic elements on a page layout can now be cloned.
A detailed list of all additions made at 10.1 is below.
New top-level arcpy.mapping functions:
- AddTableView—Provides the ability to add a table to a data frame within a map document (.mxd).
- AnalyzeForSD—Analyzes Service Definition Draft (.sddraft) files to determine suitability and sources of potential performance issues before converting a Service Definition Draft file to a Service Definition (.sd) file.
- ConvertWebMapToMapDocument—Converts a WebMap (in JSON format) that you intend to print or export to a map document. The map document can be further modified before finally being printed or exported.
- CreateGISServerConnectionFile—This function creates a connection file that can be used to connect to a GIS Server.
- CreateMapSDDraft—Converts Map Document (.mxd) files to Service Definition Draft (.sddraft) files.
- ExportReport—Exports a formatted, tabular report using data from layers or stand-alone tables in a map document along with the report template information that is provided in a report layout file (.rlf).
- ListBookMarks—Returns a Python list of named tuples that provide access to each spatial bookmark's name and extent.
- ListStyleItems—Returns a Python list of StyleItem objects. A referenced legend item from a style file (.style) can then be used to update already existing legend items in a layout.
- RemoveTableView—Provides the ability to remove a table within a data frame in a map document (.mxd).
- TableView—Enables you to reference a table in a workspace as a TableView object so that it can be added to a map document.
- UpdateLayerTime—Provides the ability to update a layer's time properties for a layer in a map document (.mxd) by extracting time properties from a source layer.
Updated top-level arcpy.mapping functions:
- PrintMap—Added image_quality parameter.
New arcpy.mapping classes:
- GraduatedColorsSymbology—Provides access to different properties that allow you to change the appearance of a layer's graduated colors symbology.
- GraduatedSymbolsSymbology—Provides access to different properties that allow you to change the appearance of a layer's graduated symbols symbology.
- LayerTime—Provides access to time management operations for time-enabled layers.
- RasterClassifiedSymbology—Provides access to different properties that allow you to change the appearance of a layer's raster classified symbology.
- StyleItem—Provides access to StyleItem class properties.
- UniqueValueSymbology—Provides access to different properties that allow you to change the appearance of a layer's unique value symbology.
Updated arcpy.mapping classes:
- DataDrivenPages Class
- exportToPDF()—Added optional parameter called show_selection_symbology.
- dataFrame—Returns a reference to the data frame the index layer resides within a Data Driven Pages enabled map document.
- indexLayer—Returns a reference to the index layer in a Data Driven Pages enabled map document.
- pageNameField—Returns a field object that represents the field used in the index feature class when setting up Data Driven Pages.
- selectedPages—Returns a Python list of index numbers that represent selected index layer features in a Data Driven Pages enabled map document.
- GraphicElement Class
- clone()—Provides a mechanism to clone an existing graphic element on a page layout.
- delete()—Provides a mechanism to delete an existing graphic element on a page layout.
- Layer Class
- isBroken—Returns True if a layer's data source is broken.
- isNetworkAnalystLayer—Returns True if a layer is an ArcGIS Network Analyst layer type.
- maxScale—Provides the ability to set or get the layer's maximum scale threshold.
- minScale—Provides the ability to set or get the layer's minimum scale threshold.
- symbology—Returns a reference to the layer's symbology class. Each supported layer symbology class has its own unique set of properties.
- symbologyType—Returns a string that represents the layer's symbology class type.
- time—Returns the LayerTime class that provides access to time properties of time-enabled layers.
- LegendElement Class
- listLegendItemLayers()—Returns a list of Layer object references for every legend item in a legend.
- removeItem()—The removeItem method allows you to remove a legend item from a legend on a layout.
- updateItem()—The updateItem method allows you to update a number of individual properties for a legend item within a legend on a layout.
- isOverflowing—Returns True if the legend items can't fit when the Fixed Frame option is set within legend properties.
- MapDocument Class
- activeDataFrame—Returns a DataFrame object that represents the currently active data frame in a map document ( .mxd).
- isDDPEnabled—Returns True if the map document is Data Driven Pages enabled.
- pageSize—Provides the ability to get the layout's page size. It returns a named tuple with the properties width and height.
- PDFDocument Class
- deletePages()—Provides the ability to delete one or multiple pages within an existing PDF document.
- TableView Class
- isBroken—Returns True if a tableview's data source is broken.
- TextElement Class
- clone()—Provides a mechanism to clone an existing text element on a page layout.
- delete()—Provides a mechanism to delete an existing text element on a page layout.
- fontSize—The element font size in page units.