the benefits of python in gis - florida chapter iaao conference/gis python...• “a python primer...

25
Python Scripting: Let the Snake take a bite out of Time Slithery-Smooth GIS Process Automation Martin County Property Appraiser’s Office John Watterson – GIS Specialist

Upload: truongcong

Post on 25-May-2018

233 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: The benefits of Python in GIS - Florida Chapter IAAO Conference/GIS Python...• “A Python Primer for ArcGIS”, ... • “GIS Tutorial for Python Scripting”, Allen. Questions

Python Scripting: Let the Snake take a bite out of Time

Slithery-Smooth GIS Process Automation

Martin County Property Appraiser’s Office

John Watterson – GIS Specialist

Page 2: The benefits of Python in GIS - Florida Chapter IAAO Conference/GIS Python...• “A Python Primer for ArcGIS”, ... • “GIS Tutorial for Python Scripting”, Allen. Questions

What is Python?

• Free open source programming language used in numerous fields, not just GIS

• Non-profit foundation: www.python.org

• Embraced by ESRI for the long haul

Page 3: The benefits of Python in GIS - Florida Chapter IAAO Conference/GIS Python...• “A Python Primer for ArcGIS”, ... • “GIS Tutorial for Python Scripting”, Allen. Questions

History of Python at the PAO

• Since 2008

• Easy to learn

• Clear and logical syntax

Page 4: The benefits of Python in GIS - Florida Chapter IAAO Conference/GIS Python...• “A Python Primer for ArcGIS”, ... • “GIS Tutorial for Python Scripting”, Allen. Questions

Basic benefits of using Python in ArcGIS

• Saves work time; and therefore money

• Perfect for automating redundant geoprocessing

• No programming experience required

Page 5: The benefits of Python in GIS - Florida Chapter IAAO Conference/GIS Python...• “A Python Primer for ArcGIS”, ... • “GIS Tutorial for Python Scripting”, Allen. Questions

Basic benefits of using Python in ArcGIS continued

• Elimination of human error

• Versatility: Can run in ArcToolbox

• Increased productivity; Scheduled tasks

Page 6: The benefits of Python in GIS - Florida Chapter IAAO Conference/GIS Python...• “A Python Primer for ArcGIS”, ... • “GIS Tutorial for Python Scripting”, Allen. Questions

Return on Investment

• Can be huge

• Martin County Property Appraiser’s Office uses 12 Python Scripts

Page 7: The benefits of Python in GIS - Florida Chapter IAAO Conference/GIS Python...• “A Python Primer for ArcGIS”, ... • “GIS Tutorial for Python Scripting”, Allen. Questions

What the experts are saying

• Adena Schutzberg of Directions Magazine: Scripting = understanding building blocks of GIS

• Jack Dangermond: Python, Python, Python

• Python scripting – A sought-after skill in the GIS job marketplace

• “Yes, You Need to Code” blog article

Page 8: The benefits of Python in GIS - Florida Chapter IAAO Conference/GIS Python...• “A Python Primer for ArcGIS”, ... • “GIS Tutorial for Python Scripting”, Allen. Questions

Starting point for writing scripts

• ArcGIS Desktop Help – A valuable resource

• Locate favorite tools in ArcToolbox and right click

Page 9: The benefits of Python in GIS - Florida Chapter IAAO Conference/GIS Python...• “A Python Primer for ArcGIS”, ... • “GIS Tutorial for Python Scripting”, Allen. Questions

PDF tax maps to web script

Page 10: The benefits of Python in GIS - Florida Chapter IAAO Conference/GIS Python...• “A Python Primer for ArcGIS”, ... • “GIS Tutorial for Python Scripting”, Allen. Questions

Standard lines of Python code

Page 11: The benefits of Python in GIS - Florida Chapter IAAO Conference/GIS Python...• “A Python Primer for ArcGIS”, ... • “GIS Tutorial for Python Scripting”, Allen. Questions

Script finished successfully message

Page 12: The benefits of Python in GIS - Florida Chapter IAAO Conference/GIS Python...• “A Python Primer for ArcGIS”, ... • “GIS Tutorial for Python Scripting”, Allen. Questions

Do the math!

2 hours manually x 12 months =

24 hours saved or 3 working days per year!

PDF tax maps to web script

Page 13: The benefits of Python in GIS - Florida Chapter IAAO Conference/GIS Python...• “A Python Primer for ArcGIS”, ... • “GIS Tutorial for Python Scripting”, Allen. Questions

Value Annotation Script

Page 14: The benefits of Python in GIS - Florida Chapter IAAO Conference/GIS Python...• “A Python Primer for ArcGIS”, ... • “GIS Tutorial for Python Scripting”, Allen. Questions

Do the math!

2 hours manually x 2 times a week x 5.5 month valuation period (22 weeks) =

88 hours saved or 11 working days per year!

Value Annotation Script

Page 15: The benefits of Python in GIS - Florida Chapter IAAO Conference/GIS Python...• “A Python Primer for ArcGIS”, ... • “GIS Tutorial for Python Scripting”, Allen. Questions

Neighborhood script

Page 16: The benefits of Python in GIS - Florida Chapter IAAO Conference/GIS Python...• “A Python Primer for ArcGIS”, ... • “GIS Tutorial for Python Scripting”, Allen. Questions

Do the math!

30 minutes manually x 2 times a year = 1 hour a year

Neighborhood script

Page 17: The benefits of Python in GIS - Florida Chapter IAAO Conference/GIS Python...• “A Python Primer for ArcGIS”, ... • “GIS Tutorial for Python Scripting”, Allen. Questions

CAMA shapefile to web script

Page 18: The benefits of Python in GIS - Florida Chapter IAAO Conference/GIS Python...• “A Python Primer for ArcGIS”, ... • “GIS Tutorial for Python Scripting”, Allen. Questions

CAMA shapefile to web script

45 minutes manually x 12 times a year =

9 hours saved a year or approximately 1 work day per year!

Do the math!

Page 19: The benefits of Python in GIS - Florida Chapter IAAO Conference/GIS Python...• “A Python Primer for ArcGIS”, ... • “GIS Tutorial for Python Scripting”, Allen. Questions

Do the Math!!

With all the scripts we run at the PAO, Python has saved

me 1 month per year!

Page 20: The benefits of Python in GIS - Florida Chapter IAAO Conference/GIS Python...• “A Python Primer for ArcGIS”, ... • “GIS Tutorial for Python Scripting”, Allen. Questions

Python command Line in ArcGIS

• Open right in ArcMap

• Start typing Python commands

• Auto-complete feature

• Walk through help window

Page 21: The benefits of Python in GIS - Florida Chapter IAAO Conference/GIS Python...• “A Python Primer for ArcGIS”, ... • “GIS Tutorial for Python Scripting”, Allen. Questions

Add-ins with Python

• New to ArcGIS 10.1

• Extending the ArcGIS interface

• So what’s next?

Page 22: The benefits of Python in GIS - Florida Chapter IAAO Conference/GIS Python...• “A Python Primer for ArcGIS”, ... • “GIS Tutorial for Python Scripting”, Allen. Questions

Python advantages over ModelBuilder

• Visualization of code

• Model Builder (MB) has no mapping module • Limited in advanced programming methods(MB)

• Run outside of ArcGIS

• Suitable for writing complex script workflows

• More Help

Page 23: The benefits of Python in GIS - Florida Chapter IAAO Conference/GIS Python...• “A Python Primer for ArcGIS”, ... • “GIS Tutorial for Python Scripting”, Allen. Questions

Course resources

• Geospatial Training Services: www.geospatialtraining.com

• ESRI:

www.esri.com/training/main

Page 24: The benefits of Python in GIS - Florida Chapter IAAO Conference/GIS Python...• “A Python Primer for ArcGIS”, ... • “GIS Tutorial for Python Scripting”, Allen. Questions

GIS Python books

• “Python Scripting for ArcGIS”, Zanderbergen

• “A Python Primer for ArcGIS”, Jennings

• “Programming ArcGIS 10.1 with Python Cookbook”, Pimpler

• “Python Geospatial Development”, Westra

• “GIS Tutorial for Python Scripting”, Allen

Page 25: The benefits of Python in GIS - Florida Chapter IAAO Conference/GIS Python...• “A Python Primer for ArcGIS”, ... • “GIS Tutorial for Python Scripting”, Allen. Questions

Questions or Comments