Download presentation
Presentation is loading. Please wait.
Published byJacob Boyd Modified over 9 years ago
1
Automating Processes with ArcPy to do work so I don’t have to Joe Guzi GIS Systems Analyst Stark County GIS Department 2015 Ohio GIS Conference September 21 - 23, 2015 | Hyatt Regency Columbus| Columbus, Ohio
2
Why Automate processes? Not only to do work so I don’t have to But mainly to Free me up to do more work
3
Why do more work? Because work leads to Taking Over the world!
5
Automaton Strategies Walk through Process Test Be prepared Task Scheduler and BAT Files Maintenance Excel Sheet To Maintain Schedule Code Examples
6
Automaton Strategies: Walk through process
9
Automaton Strategies: Test
11
Automaton Strategies: Test Again
12
Automaton Strategies: Task Scheduler and BAT Files
13
Bat Files ▫Just Text Files saved with a bat extension ▫Written using DOS Commands ▫Syntax
14
Automaton Strategies: Task Scheduler and BAT Files
15
Task Scheduler Parameters: ▫Trigger – Declare when the task will run and how frequently ▫Actions – Declare what the Task will do ▫Conditions – Declare computer setting for power or idle ▫Settings – Determine how the task can be treated Allow the task to run on demand Stop the task if it takes forever
16
Excel Sheet to Maintain Schedule
17
Code Examples
18
Code Examples: Layer Update Automation
19
Code Examples: Feature Update Email Notification
20
Code Examples: Automation of Tax Map Updates
21
Code Examples: Cache Error Detection
22
Python Tips and Tricks Section your code Comment Comment Comment Use Print Command Error Block Email Notification Create Logs Time Use Resources
23
Python Tips and Tricks: Section your code Description Import Section Variables Processes Output Error Reporting
25
Python Tips and Tricks: Comment Comment Comment Comment everything If you change your code comment the change You never know when you will have to come back to your code and commenting will be the best way to remember why you did something Also commenting is good back up in case something happened to the author (God forbid)
26
Python Tips and Tricks: Comment Comment Comment
27
Python Tips and Tricks: Use the print Command
28
Python Tips and Tricks: Error blocks
29
Python Tips and Tricks: Email Notification
30
Python Tips and Tricks: Create logs
31
Python Tips and Tricks: Time Time Libraries: ▫Time ▫Datetime Time.gmtime datetime.datetime.utcnow() datetime.timedelta(minutes = 15) str(DayAgo)[0:19] "( LAST_EDITED_DATE >= '" + DayAgoFormat + "' )"
32
Python Tips and Tricks: Use Resources Python Window in ArcGIS desktop ArcGIS Resources Python Section Geoprocessing Tool References GitHub Friends Python Documentation Site
33
Questions? Joe Guzi jsguzi@starkcountyohio.gov 330-451-7188
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.