Python – Beyond the Basics

Slides:



Advertisements
Similar presentations
Publishing GIS Services to ArcGIS for Server
Advertisements

Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California ArcGIS Tracking Analyst – an Introduction Morakot Pilouk,
Esri UC 2014 | Technical Workshop | Automating Cache Workflows and Tile Usage Heat Maps Eric J. Rodenberg.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Building Secure Applications.
Esri UC 2014 | Technical Workshop | Optimizing Your JavaScript Web App for Performance Jeremy Bartley Derek Swingley.
Esri UC2013. Technical Workshop.Editing & Maintaining Parcels with ArcGIS.
Esri UC 2014 | Technical Workshop | Data Alignment and Management in ArcMap Lisa Stanners, Sean Jones.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Editing in ArcMap:
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California ArcGIS for Local Government.
Esri International User Conference | San Diego, CA Technical Workshops | Loading CAD data into the Geodatabase Alex LeReaux Thursday, July 14, 2011 – 10:15.
Technical Workshops | Esri International User Conference San Diego, California ArcMap: Tips and Tricks Miriam Schmidts Jorge Ruiz-Valdepena July 23 – 27,
Esri International User Conference | San Diego, CA Technical Workshops | Python – Getting Started Drew Flater, Ghislain Prince July 12 - July 14, 2011.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Generalization for.
Your Campus and the Living Atlas of the World Mark Stewart.
Overview Cursors arcpy.da module Geometrys Arrays SpatialReferences
Python: An Introduction
Esri UC 2014 | Demo Theater | Esri Production Mapping: Configuring Business Rules Joseph Sheffield.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California ArcGIS API for Flex.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Migrating your Data.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Applying ArcGIS Spatial.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Caching Imagery Using.
Esri UC 2014 | Technical Workshop | Esri Roads and Highways: Integrating and Developing LRS Business Systems Tom Hill.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California 3D Analyst – Feature.
Technical Workshops | Esri International User Conference San Diego, California Creating Geoprocessing Services Kevin Hibma, Scott Murray July 25, 2012.
ArcGIS Server for Administrators
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.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Geodatabase Administration:
Python Beyond the Basics …. Ghislain Prince Jeff Bigos.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Geocoding – An 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 Automating Geodatabase.
Esri UC 2014 | Demo Theater | Esri Production Mapping: Spatial Document Management Joseph Sheffield.
Esri UC 2014 | Technical Workshop | Creating Geoprocessing Services Kevin Hibma.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Customizing the Operations.
Esri UC 2014 | Technical Workshop | Using ArcGIS Online Analysis Widgets Shing Lin, Jerome Yang.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Migrating Parcel data.
Esri UC 2014 | Technical Workshop | ArcGIS API for JavaScript: What’s New Derek Swingley Jerome Yang
Esri UC 2014 | Technical Workshop | Managing and Editing Annotation Wendy Harrison.
Esri UC2013. Technical Workshop. Demo Theater 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Introduction to the Esri.
Esri UC 2014 | Technical Workshop | Python: Beyond the Basics David Wynne, Jon Bodamer.
Data Alignment and Management in ArcMap
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 UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Making Beautiful Maps.
Esri UC 2014 | Technical Workshop | ArcGIS API for JavaScript: An Introduction Kelly Hutchins Derek Swingley.
Esri UC 2014 | Technical Workshop | Editing in ArcMap: An Introduction Lisa Stanners, Phil Sanchez.
Python: Building Geoprocessing Tools David Wynne, Ghislain Prince.
Lecture 10: Geoprocessing with Python (II) Dr. Taysir Hassan Abdel Hamid Associate Professor, Information Systems Dept., Faculty of Computers and Information.
Esri UC2013. Technical Workshop. Technical Workshop 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Working with Cartographic.
Technical Workshops | Esri International User Conference San Diego, California Branching and Iteration in ModelBuilder Shitij Mehta July 24, :15.
Esri UC 2014 | Technical Workshop | Administering ArcGIS for Server with Python Jon Bodamer.
Esri UC 2014 | Technical Workshop | Migrating Data To The Parcel Fabric Christine Leslie Amir Bar-Maor.
Esri UC 2014 | Technical Workshop | Enhancing Web Map Performance in ArcGIS Online Julia Guard & Melanie Summers.
Python – Beyond the Basics
PYTHON: AN INTRODUCTION
Geoprocessing with ArcGIS for Server
ArcGIS for the Military—Land Operations
Mapmaking Beyond the Basics
Python Map Automation – Beyond the Basics of arcpy.mapping
Learning Common GIS Workflows
Building Map Books in ArcGIS
Consuming Geoprocessing and Hosted Analytic Services in ArcGIS for Desktop Kevin Hibma.
ArcGIS Pro: What’s New in Editing and Data Management
Python Map Automation – Beyond the Basics of arcpy.mapping
ModelBuilder – Getting Started
PYTHON: BUILDING GEOPROCESSING TOOLS
Desktop Mapping: Building Map Books
Presentation transcript:

Python – Beyond the Basics 2013 Esri International User Conference July 8–12, 2013 | San Diego, California Technical Workshop Python – Beyond the Basics David Wynne, Ken Smith

Data structures & functions Agenda Data structures & functions Classes Geometry 1 2 3 4 5 Script tools Cursors Python – Beyond the Basics

Python 201: Data structures & functions Python – Beyond the Basics

Key Python data structures Lists Tuples Flexible Immutable Ordered Dictionary Key/value pairs Python – Beyond the Basics

List comprehension Compact way of mapping a list into another Python – Beyond the Basics

Defining Functions Organize and re-use functionality Define your function Return a result Call the function Python – Beyond the Basics

Demo Data structures Python – Beyond the Basics

Script tools Python – Beyond the Basics

Demo Quadrat Analysis tool Python – Beyond the Basics

Geoprocessing Framework and Python Tools can be called from Python Python code can be turned into a tool A script tool… Looks and behaves like any system tool Provides default validation Has no UI programming Python – Beyond the Basics

Script tools Tools have parameters Script tools support messages Use GetParameterAsText (or GetParameter) to get inputs Script tools support messages arcpy.AddMessage arcpy.AddWarning arcpy.AddError Python – Beyond the Basics

Tip: Script Template http://esriurl.com/4558 Python – Beyond the Basics

Quadrat Analysis tool Part B: Jump start your analysis with a template Demo Quadrat Analysis tool Part B: Jump start your analysis with a template Python – Beyond the Basics

arcpy classes Python – Beyond the Basics

arcpy classes Classes are used to create objects Frequently used for… Tool parameters Working with geometry Python – Beyond the Basics

arcpy Classes Most tool parameters are easily defined with a string or number Some are not: Spatial reference Field map Classes can be used to define these parameters Python – Beyond the Basics

Using classes for parameters Extent SpatialReference Python – Beyond the Basics

Quadrat Analysis tool Part C: Extent class Cursors Chi-square function Demo Quadrat Analysis tool Part C: Extent class Cursors Chi-square function Python – Beyond the Basics

Recap Fast development A script template gets you started Easy access to tools and functions through arcpy No UI development required Script tools provide default validation Python – Beyond the Basics

Recap… Used a function to define / group useful functionality Used open source libraries (numpy) Easy to share and deploy No ArcObjects or dlls to register Python – Beyond the Basics

Cursors Python – Beyond the Basics

Cursors Use cursors to access records and features Two varieties ‘Classic’ cursors ‘Data access’ cursors (new at 10.1) SearchCursor Read-only UpdateCursor Update or delete rows InsertCursor Insert rows Python – Beyond the Basics

Cursor mechanics Data access cursors use lists and tuples Values are accessed by index Classic cursors use row objects Values are accessed by setValue/getValue Python – Beyond the Basics

With statements arcpy.da Cursors support with statements Python – Beyond the Basics

Cursor performance Use only those fields you need Use tokens Get only what you need Full geometry is expensive Python – Beyond the Basics

Demo arcpy.da cursors Python – Beyond the Basics

Geometry Python – Beyond the Basics

Geometry and cursors Can create geometry in different ways Geometry objects List of coordinates Using other formats JSON, WKT, WKB Python – Beyond the Basics

Geometry and cursors Can create geometry in different ways Geometry objects List of coordinates Using other formats JSON, WKT, WKB Python – Beyond the Basics

Working with geometry Relational: Is a point within a polygon? Python – Beyond the Basics

Working with geometry Topological What is the intersection of two geometries? Python – Beyond the Basics

Working with geometry Others What is the halfway point of a line? What is the geodesic area of a polygon? Python – Beyond the Basics

Resources Python resource center ArcPy Café Python at UC 2013 pro.arcgis.com/analysis/python/ ArcPy Café arcpy.wordpress.com Python at UC 2013 esriurl.com/uc13python Python – Beyond the Basics

First Offering ID (Tues.): 1210 Second Offering ID (Wed.): 1311 Thank you… Please fill out the session evaluation First Offering ID (Tues.): 1210 Second Offering ID (Wed.): 1311 Online – www.esri.com/ucsessionsurveys Paper – pick up and put in drop box Python – Beyond the Basics

Python – Beyond the Basics