Python Map Automation: Introduction to arcpy.mapping / arcpy.mp

Slides:



Advertisements
Similar presentations
Geo GIS Practicuum Introduction to ArcGIS 8 Exercise 5 - ESRI Virtual Campus Chapters 1-2, ArcGIS Methods …
Advertisements

Creating Map Books ArcMap 10 Data Driven Pages
Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California ArcGIS Tracking Analyst – an Introduction Morakot Pilouk,
Intro to ArcGIS for New Users. ArcGIS Desktop Advanced GeoprocessingArcInfo ArcReader Data Access Map Viewing Query Advanced EditingArcEditor ArcView.
Providing Info & Maps to Non-GIS Users & Tips, Tricks in ArcGIS with Gary Moody.
Esri UC 2014 | Technical Workshop | Automating Cache Workflows and Tile Usage Heat Maps Eric J. Rodenberg.
Unit One: GIS Concepts In this unit… ► What is GIS? ► Types of GIS data ► What can you do with GIS? ► ArcGIS 9 license levels ► Basics of the ArcGIS 9.
Esri UC 2014 | Technical Workshop | Performing Advanced Cartography with Esri Production Mapping Clint Loveman & Madhura Phaterpekar.
19 th Advanced Summer School in Regional Science Overview and more advanced directions with ArcGIS.
Introduction To ArcMap ArcMa p. ArcMap is a Map-centric GUI tool used to perform map-based tasks Mapping –Create maps by working geographically and interactively.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Editing in ArcMap:
ArcGIS Workflow Manager An Introduction
Technical Workshops | Esri International User Conference San Diego, California ArcMap: Tips and Tricks Miriam Schmidts Jorge Ruiz-Valdepena July 23 – 27,
A Sample Print Web Service Utilizing ArcGIS Server and ArcObjects Cheryl Spencer, IndyGIS Marianne Cardwell, Woolpert.
1/36. 2/36 Something cool …
Esri International User Conference | San Diego, CA Technical Workshops | ArcGIS ArcMap: Printing, Exporting, and ArcPress Michael Grossman Jeremy Wright.
A New Generation GIS for the Classroom ArcGIS 9.0 A New Generation GIS for the Classroom.
Network Analysis with Python
Python: An Introduction
ArcGIS Network Analyst: Automating Workflows with Geoprocessing
Publishing to ArcGIS for Server
Enabling High-Quality Printing in Web Applications
ArcGIS Pro: An Introduction
Working with Metadata in ArcGIS Aleta Vienneau. Working with metadata in ArcGIS View metadata Edit metadata Set your metadata style Leverage metadata.
ArcGIS Pro: A Quick Tour of Python David Wynne.
ArcGIS Pro: Mapping and Visualization Craig Williams, Edie Punt, &
Advance Map Automation With Python
Esri Defense Mapping: Cartographic Production
Esri UC 2014 | Demo Theater | Troubleshooting Printing and Exporting from ArcMap Michael Grossman.
Preparing and Deploying Data to ArcPad Juan Luera.
MXD, Maps, Layers arcpy.mapping Classes.
Technical Workshops | Esri International User Conference San Diego, California Creating Geoprocessing Services Kevin Hibma, Scott Murray July 25, 2012.
Esri UC 2014 | Technical Workshop | Python Map Automation – Beyond the Basics of arcpy.mapping Jeff Barrette Jeff Moulds.
Technical Workshops | Esri International User Conference San Diego, California Supporting High-Quality Printing in Web Applications with ArcGIS 10.1 for.
ArcGIS Workflow Manager Introduction
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Supporting High-Quality.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Building Map Books.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Sharing Workflows with.
Working with Feature Services Gary MacDougall Russell Brennan.
Getting the most out of ArcMap Jack Horton & Jorge Ruiz-Valdepeña.
Introduction Presenter: James Zollweg, Ph.D. Associate Professor of Water Resources and GIS The College at Brockport NYS GIS Association – Python Training,
Esri UC 2014 | Technical Workshop | Creating Geoprocessing Services Kevin Hibma.
Map Books & Dynamic Tables
Desktop Mapping: Building Map Books Jeff Barrette Michael Grossman.
Esri UC 2014 | Demo Theater | Ten ArcMap Tips and Tricks Michael Grossman.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Python Map Automation.
Publishing GIS Services to ArcGIS Server
Esri UC 2014 | Technical Workshop | Python Map Automation – Introduction to arcpy.mapping Michael Grossman Jeff Barrette.
Esri UC 2014 | Technical Workshop | Editing in ArcMap: An Introduction Lisa Stanners, Phil Sanchez.
Python: Building Geoprocessing Tools David Wynne, Ghislain Prince.
Brief Comparison of ArcView 3.x and ArcView 8.x Paige Baldassaro Geospatial Applications Designer Geospatial Extension Program Sunday, March 20, 2016
Jeff Barrette Jeff Moulds
ArcGIS Pro Mapping and Visualization
ArcGIS Workflow Manager: Advanced Workflows and Concepts
Desktop Mapping: Building Map Books
Shankar Chandrasekaran
Geoprocessing with ArcGIS for Server
Python Map Automation – Introduction to arcpy.mapping
Introduction To ArcMap
Python Map Automation – Beyond the Basics of arcpy.mapping
Building Map Books in ArcGIS
Python Map Automation – Beyond the Basics of arcpy.mapping
Network Analysis using Python
PYTHON: BUILDING GEOPROCESSING TOOLS
Building Map Books in ArcGIS
Network Analyst – Automating Workflows with Geoprocessing
Geog 375 Individual Final Programming Project: Automated Thematic Maps
Desktop Mapping: Building Map Books
ArcGIS Pro: An Introduction Overview
Presentation transcript:

Python Map Automation: Introduction to arcpy.mapping / arcpy.mp Jeff Barrette

What is arcpy.mapping? Python mapping module that is part of the ArcPy site-package An API that allows users to: manage map documents, layer files, and their contents find a layer with data source X and replace with Y update a layer’s symbology in many MXDs generate reports that lists document information data sources, broken layers, spatial reference info, etc. Automate the exporting and printing of map documents Automate map production and create map books extend Data Driven Pages capabilities UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping

Who is arcpy.mapping for? Why was it built? An easy to use, productive scripting environment for the GIS Analyst courser grained object model not a complete replacement for ArcObjects An environment to use for basic map/layer management and map automation tasks A simple way to publish mapping tasks to the server environment arcpy.mapping scripts can be easily published as geoprocessing tools UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping

Tour of arcpy.mapping Overview sa da ga mapping arcpy UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping

Functions provide access to classes AddLayer AddLayerToGroup CreateMapSDDraft InsertLayer Layer ListBrokenDataSources ListDataFrames ListLayers ListLayoutElements ListTableViews MapDocument MoveLayer RemoveLayer UpdateLayer ... CLASSES DataFrame/Time GraduatedColorSym GraphicElement LabelClass Layer/Time LegendElement MapDocument MapSurroundElement PictureElement RasterClassified StyleItems TableView TextElement UniqueValueSym ... UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping

Python window Quick and easy access to Python and arcpy Gateway for new users to learn Python Intellisense for all tools, methods and properties & help window Quickly and efficiently execute tools UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping

arcpy.mapping help http://esriurl.com/8148 Desktop  Geoprocessing  ArcPy  Mapping module UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping

Demonstration The Python Window and using the Desktop Help System UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping

Referencing map documents MapDocument class MapDocument function MapDocument(mxd_path) Methods replaceWorkspaces save saveAsCopy ... Properties: activeDataFrame author credits relativePaths UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping

Referencing map documents (MXDs) Opening Map Documents (MXD) with arcpy.mapping Use the MapDocument function Takes a path to MXD file on disk or special keyword "CURRENT“ Reference map on disk mxd = arcpy.mapping.MapDocument(r"C:\some.mxd") Get map from current ArcMap session mxd = arcpy.mapping.MapDocument("CURRENT") UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping

Referencing map documents (MXDs), cont. When using CURRENT Always run in foreground (checkbox in script tool properties) May need to refresh the application arcpy.RefreshActiveView() Limitations and pre-authoring No "New Map" function, so keep an empty MXD available Can’t create new objects (e.g., north arrow, data frame) UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping

Demonstration Working with Map Documents (MXDs) Use Python Window to change map document property info Evaluate relative paths, last saved, etc. Change the active view Save changes out to a new file UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping

Layers and data frames The “List” functions Layer properties ListLayers and ListDataFrames Watch the list indexes (it is easy to forget to use [0]) df = arcpy.mapping.ListDataFrames(MXD)[0] Layer properties Common properties are available (e.g., def query, visible) All properties can be updated via layer (.lyr) files DataFrame properties and methods Basic map navigation and settings UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping

Layers and Data Frames Data Frame Class Layer functions Layer Methods ListLayers ListTableViews AddLayer AddLayerToGroup InsertLayer MoveLayer RemoveLayer UpdateLayer ... Methods panToExtent(extent) zoomToSelectedFeatures() Properties: credits description displayUnits elementHeight elementPositionX extent scale ... UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping

Demonstration Working with Layers and Data Frames Find a layer and turns it on or off Modify the scale/rotation of a data frame Zoom to selected features UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping

Page Layout Elements Must pre-author most elements Uniquely name your layout elements Set the appropriate anchor Only graphics and text can be cloned Move elements off the page UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping

Demonstration Working with layout elements Find a picture element and change its data source UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping

Printing, exporting, server publishing, map books CLASSES DataDrivenPages PDFDocument FUNCTIONS ExportReport ExportToAI ExportToBMP ExportToEPS ExportToGIF ExportToJPEG ExportToPDF ExportToPNG ExportToSVG ExportToTIFF PDFDocumentCreate PDFDocumentOpen PrintMap CreateMapSDDraft ... UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping

Demonstration Map output and map books Map book that includes index pages using Python ReportLab Sample: http://esriurl.com/4629 UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping

Updating data sources Use arcpy.mapping for migrating Map Documents and Layer files to new data sources Fancier scripts can help mitigate migration pain: SQL syntax changes, field name changes, etc A complete concept document is dedicated to this topic “Updating and fixing data sources with arcpy.mapping” http://esriurl.com/8149 UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping

Demonstration arcpy.mapping sample script tools UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping

Resources available ArcGIS Resource Center (web help) http://esriurl.com/8148 Alphabetical lists of classes and functions Detailed discussions Multiple sample scripts for each class and function topic ArcGIS Online – arcpy.mapping / Map Automation group Download sample scripts http://esriurl.com/8899 UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping

Migrating to ArcGIS Pro Help Topic: Migrating arcpy.mapping from ArcMap to ArcGIS Pro Python 3.4 ArcGIS project file (.aprx) Stand-alone functions have moved to appropriate classes mapFrame.exportToPDF() map.addLayer(), map.insertLayer(), etc Layer files have changed DataFrame replace by Map, MapFrame, and Camera New Layout object Application always refreshes when using CURRENT UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping

Related Sessions Desktop Mapping: Building Map Books Wednesday, 10:15am – 11:30am, Room 2 Thursday, 8:30am - 9:45am, Room 05 B Advanced Map Automation with Python Wednesday, 3:15pm – 4:30pm, Room 15 B Thursday, 1:30pm - 2:45pm, Room 07 A/B UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping