SlideShare une entreprise Scribd logo
1  sur  24
Télécharger pour lire hors ligne
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
Overview
Tour of arcpy.mapping
sa
da ga mapping
arcpy
UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping
• 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
Python window
UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping
• Desktop  Geoprocessing  ArcPy  Mapping module
arcpy.mapping help http://esriurl.com/8148
UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping
• The Python Window and using the Desktop Help System
Demonstration
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
• 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")
Referencing map documents (MXDs)
UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping
• 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)
Referencing map documents (MXDs), cont.
UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping
• 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
Demonstration
UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping
• The “List” functions
- 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
Layers and data frames
UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping
Layers and Data Frames
Data Frame Class
Layer
ListLayers
ListTableViews
AddLayer
AddLayerToGroup
InsertLayer
MoveLayer
RemoveLayer
UpdateLayer
...
Layer functions
Methods
panToExtent(extent)
zoomToSelectedFeatures()
Properties:
credits
description
displayUnits
elementHeight
elementPositionX
extent
scale
...
UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping
• 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
Demonstration
UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping
• 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
Page Layout Elements
UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping
• Working with layout elements
• Find a picture element and change its data source
Demonstration
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
• Map output and map books
Map book that includes index pages using Python ReportLab
Sample: http://esriurl.com/4629
Demonstration
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
• arcpy.mapping sample script tools
• Sample: http://esriurl.com/4622
Demonstration
UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping
• 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
Resources available
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
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
Related Sessions
UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping
Python Map Automation - Introduction of Arcpy Mapping

Contenu connexe

Similaire à Python Map Automation - Introduction of Arcpy Mapping

An introduction To Apache Spark
An introduction To Apache SparkAn introduction To Apache Spark
An introduction To Apache SparkAmir Sedighi
 
Build, Scale, and Deploy Deep Learning Pipelines Using Apache Spark
Build, Scale, and Deploy Deep Learning Pipelines Using Apache SparkBuild, Scale, and Deploy Deep Learning Pipelines Using Apache Spark
Build, Scale, and Deploy Deep Learning Pipelines Using Apache SparkDatabricks
 
Overview of Apache Spark 2.3: What’s New? with Sameer Agarwal
 Overview of Apache Spark 2.3: What’s New? with Sameer Agarwal Overview of Apache Spark 2.3: What’s New? with Sameer Agarwal
Overview of Apache Spark 2.3: What’s New? with Sameer AgarwalDatabricks
 
Esri South Africa Python for Everyone
Esri South Africa Python for EveryoneEsri South Africa Python for Everyone
Esri South Africa Python for EveryoneEsri South Africa
 
Spark: The State of the Art Engine for Big Data Processing
Spark: The State of the Art Engine for Big Data ProcessingSpark: The State of the Art Engine for Big Data Processing
Spark: The State of the Art Engine for Big Data ProcessingRamaninder Singh Jhajj
 
NDGISUC2017 - Introducing ArcGIS Pro
NDGISUC2017 - Introducing ArcGIS ProNDGISUC2017 - Introducing ArcGIS Pro
NDGISUC2017 - Introducing ArcGIS ProNorth Dakota GIS Hub
 
Apache spark 2.4 and beyond
Apache spark 2.4 and beyondApache spark 2.4 and beyond
Apache spark 2.4 and beyondXiao Li
 
Automated Data Exploration: Building efficient analysis pipelines with Dask
Automated Data Exploration: Building efficient analysis pipelines with DaskAutomated Data Exploration: Building efficient analysis pipelines with Dask
Automated Data Exploration: Building efficient analysis pipelines with DaskASI Data Science
 
夏俊鸾:Spark——基于内存的下一代大数据分析框架
夏俊鸾:Spark——基于内存的下一代大数据分析框架夏俊鸾:Spark——基于内存的下一代大数据分析框架
夏俊鸾:Spark——基于内存的下一代大数据分析框架hdhappy001
 
Apache Spark Tutorial
Apache Spark TutorialApache Spark Tutorial
Apache Spark TutorialAhmet Bulut
 
Apache Spark™ is a multi-language engine for executing data-S5.ppt
Apache Spark™ is a multi-language engine for executing data-S5.pptApache Spark™ is a multi-language engine for executing data-S5.ppt
Apache Spark™ is a multi-language engine for executing data-S5.pptbhargavi804095
 
Large Scale Machine learning with Spark
Large Scale Machine learning with SparkLarge Scale Machine learning with Spark
Large Scale Machine learning with SparkMd. Mahedi Kaysar
 
Dive into spark2
Dive into spark2Dive into spark2
Dive into spark2Gal Marder
 
Automation in ArcGIS using Arcpy
Automation in ArcGIS using ArcpyAutomation in ArcGIS using Arcpy
Automation in ArcGIS using ArcpyGeodata AS
 
Introduction to apache spark
Introduction to apache sparkIntroduction to apache spark
Introduction to apache sparkJohn Godoi
 
ETL with SPARK - First Spark London meetup
ETL with SPARK - First Spark London meetupETL with SPARK - First Spark London meetup
ETL with SPARK - First Spark London meetupRafal Kwasny
 
NDGeospatialSummit2019 - ArcGIS Pro – Next-Generation Desktop GIS
NDGeospatialSummit2019 - ArcGIS Pro – Next-Generation Desktop GISNDGeospatialSummit2019 - ArcGIS Pro – Next-Generation Desktop GIS
NDGeospatialSummit2019 - ArcGIS Pro – Next-Generation Desktop GISNorth Dakota GIS Hub
 
Large-Scale Machine Learning with Apache Spark
Large-Scale Machine Learning with Apache SparkLarge-Scale Machine Learning with Apache Spark
Large-Scale Machine Learning with Apache SparkDB Tsai
 

Similaire à Python Map Automation - Introduction of Arcpy Mapping (20)

An introduction To Apache Spark
An introduction To Apache SparkAn introduction To Apache Spark
An introduction To Apache Spark
 
Build, Scale, and Deploy Deep Learning Pipelines Using Apache Spark
Build, Scale, and Deploy Deep Learning Pipelines Using Apache SparkBuild, Scale, and Deploy Deep Learning Pipelines Using Apache Spark
Build, Scale, and Deploy Deep Learning Pipelines Using Apache Spark
 
Overview of Apache Spark 2.3: What’s New? with Sameer Agarwal
 Overview of Apache Spark 2.3: What’s New? with Sameer Agarwal Overview of Apache Spark 2.3: What’s New? with Sameer Agarwal
Overview of Apache Spark 2.3: What’s New? with Sameer Agarwal
 
Spark7
Spark7Spark7
Spark7
 
Esri South Africa Python for Everyone
Esri South Africa Python for EveryoneEsri South Africa Python for Everyone
Esri South Africa Python for Everyone
 
Spark: The State of the Art Engine for Big Data Processing
Spark: The State of the Art Engine for Big Data ProcessingSpark: The State of the Art Engine for Big Data Processing
Spark: The State of the Art Engine for Big Data Processing
 
NDGISUC2017 - Introducing ArcGIS Pro
NDGISUC2017 - Introducing ArcGIS ProNDGISUC2017 - Introducing ArcGIS Pro
NDGISUC2017 - Introducing ArcGIS Pro
 
Apache spark 2.4 and beyond
Apache spark 2.4 and beyondApache spark 2.4 and beyond
Apache spark 2.4 and beyond
 
Automated Data Exploration: Building efficient analysis pipelines with Dask
Automated Data Exploration: Building efficient analysis pipelines with DaskAutomated Data Exploration: Building efficient analysis pipelines with Dask
Automated Data Exploration: Building efficient analysis pipelines with Dask
 
Scala and spark
Scala and sparkScala and spark
Scala and spark
 
夏俊鸾:Spark——基于内存的下一代大数据分析框架
夏俊鸾:Spark——基于内存的下一代大数据分析框架夏俊鸾:Spark——基于内存的下一代大数据分析框架
夏俊鸾:Spark——基于内存的下一代大数据分析框架
 
Apache Spark Tutorial
Apache Spark TutorialApache Spark Tutorial
Apache Spark Tutorial
 
Apache Spark™ is a multi-language engine for executing data-S5.ppt
Apache Spark™ is a multi-language engine for executing data-S5.pptApache Spark™ is a multi-language engine for executing data-S5.ppt
Apache Spark™ is a multi-language engine for executing data-S5.ppt
 
Large Scale Machine learning with Spark
Large Scale Machine learning with SparkLarge Scale Machine learning with Spark
Large Scale Machine learning with Spark
 
Dive into spark2
Dive into spark2Dive into spark2
Dive into spark2
 
Automation in ArcGIS using Arcpy
Automation in ArcGIS using ArcpyAutomation in ArcGIS using Arcpy
Automation in ArcGIS using Arcpy
 
Introduction to apache spark
Introduction to apache sparkIntroduction to apache spark
Introduction to apache spark
 
ETL with SPARK - First Spark London meetup
ETL with SPARK - First Spark London meetupETL with SPARK - First Spark London meetup
ETL with SPARK - First Spark London meetup
 
NDGeospatialSummit2019 - ArcGIS Pro – Next-Generation Desktop GIS
NDGeospatialSummit2019 - ArcGIS Pro – Next-Generation Desktop GISNDGeospatialSummit2019 - ArcGIS Pro – Next-Generation Desktop GIS
NDGeospatialSummit2019 - ArcGIS Pro – Next-Generation Desktop GIS
 
Large-Scale Machine Learning with Apache Spark
Large-Scale Machine Learning with Apache SparkLarge-Scale Machine Learning with Apache Spark
Large-Scale Machine Learning with Apache Spark
 

Dernier

UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 

Dernier (20)

UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 

Python Map Automation - Introduction of Arcpy Mapping

  • 1. Python Map Automation: Introduction to arcpy.mapping / arcpy.mp Jeff Barrette
  • 2. 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
  • 3. 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
  • 4. Overview Tour of arcpy.mapping sa da ga mapping arcpy UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping
  • 5. • 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 Python window UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping
  • 6. • Desktop  Geoprocessing  ArcPy  Mapping module arcpy.mapping help http://esriurl.com/8148 UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping
  • 7. • The Python Window and using the Desktop Help System Demonstration UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping
  • 8. 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
  • 9. • 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") Referencing map documents (MXDs) UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping
  • 10. • 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) Referencing map documents (MXDs), cont. UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping
  • 11. • 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 Demonstration UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping
  • 12. • The “List” functions - 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 Layers and data frames UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping
  • 13. Layers and Data Frames Data Frame Class Layer ListLayers ListTableViews AddLayer AddLayerToGroup InsertLayer MoveLayer RemoveLayer UpdateLayer ... Layer functions Methods panToExtent(extent) zoomToSelectedFeatures() Properties: credits description displayUnits elementHeight elementPositionX extent scale ... UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping
  • 14. • 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 Demonstration UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping
  • 15. • 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 Page Layout Elements UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping
  • 16. • Working with layout elements • Find a picture element and change its data source Demonstration UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping
  • 17. 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
  • 18. • Map output and map books Map book that includes index pages using Python ReportLab Sample: http://esriurl.com/4629 Demonstration UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping
  • 19. 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
  • 20. • arcpy.mapping sample script tools • Sample: http://esriurl.com/4622 Demonstration UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping
  • 21. • 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 Resources available UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping
  • 22. 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
  • 23. 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 Related Sessions UC2015 - Technical Workshop - Python Map Automation: Introduction to arcpy.mapping