Python Scripting For Map Automation: Jeffrey Barrette Michael Grossman
Python Scripting For Map Automation: Jeffrey Barrette Michael Grossman
Automation
Jeffrey Barrette
Michael Grossman
What is map scripting (arcpy.mapping)?
“The Line”
Existing Applications
Demonstration
What’s new at 10.1 http://esriurl.com/3880
vertl = arcpy.mapping.ListLayoutElements(
mxd, “GRAPHIC_ELEMENT”, “VerticalLine”)[0]
vertl.elementPositionX = xPos; vertl.elementPositionY = 4
vert1.elementHeight = 3
for line in range(1, numColumns+1):
vert_clone = vertLine.clone("_clone")
xPos = xPos + colWidth
vert_clone.elementPositionX = xPos
What’s new in 10.1: symbology classes
mxd = arcpy.mapping.MapDocument("current")
legend = arcpy.mapping.ListLayoutElements(mxd,
"LEGEND_ELEMENT")[0]
styleItem = arcpy.mapping.ListStyleItems(
"USER_STYLE", "Legend Items", "MyNewStyle")[0]
for lyr in legend.listLegendItemLayers():
legend.updateItem(lyr, styleItem)
Publishing Map Services with arcpy.mapping
Open and
modify MXD
Create and
analyze
SDDraft,
optionally
modify XML
Stage and
publish Map
Service
High Quality Server Printing with arcpy.mapping
• ConvertWebMapToMapDocument (webmap_json,
{template_mxd}, {notes_gdb},
{extra_conversion_options})
High Quality Server Printing with arcpy.mapping
Related Session:
Supporting High-Quality Printing in Web Applications
with ArcGIS 10.1 for Server
High Quality Server Printing with arcpy.mapping
Sample: ConvertWebMapToMapDocument
http://esriurl.com/3941
Get webmap
JSON
Template MXD
name
Related Session:
Developing ArcGIS for Desktop Add-ins with Python
Demonstration: