2. What can you automate?
Exporting maps
Adding and removing layers
Changing data sources
Change symbology
Create map books
3. Why automate?
Keeps you from doing repetitive work
Saves time, and focus for more novel
tasks
Reduces error
Allows more people to participate
Allows you to control more elements of
your maps
9. What’s the problem?
There is no consistency in our maps
Colleagues are reluctant to use
ArcGIS, so most mapping tasks fall on
me
10. Why aren’t people using
ArcGIS?
They don’t know where to start
It is intimidating
There is a sharp learning curve
No training is being offered
11. How do I encourage my
colleagues to use ArcGIS?
Remove the barriers to participation
Positive reinforcement
Regular communication and training
12. ArcGIS and map automation
Create custom tools using arcpy and
arcpy.mapping
Limit choices and narrow their focus
Help them get the desired result on the
first try
Explain what you are offering and get
feed back to improve it
13. Custom Python Script Tools
Organize things in a way that make
sense to your end users.
17. Biotoxin Map Project
What if a new area needs to be closed
(that doesn't have a pre-authored map)?
Create a new map file from a preauthored one. This ensures that data
frames, text elements, etc. are named
properly and will work with the preexisting tool.
18. Other ways we are using map
automation
We have similar tools in the works to
create other standard maps (conditional
shellfishing program, sampling station
and regulatory maps).
We are also looking into automating
some analysis and QC
19. But, are people using it?
I've gotten a lot of positive feedback so
far.
Shellfisheries staff seems to be
embracing it.
20. But I don’t know how to
code
For basic Python:
http://www.codecademy.com
ESRI makes it easy to get started with
samples: http://goo.gl/9nTfF
All of my code is available at:
https://gist.github.com/mhegeman
Show of hands—how many people are already using arcpy regularly?Kyle story:A few years ago, when I first started doing a lot of GIS stuff at work, my husband told me that I really need to learn how to code.My response was, “why would I ever want to do that?” But it turns out that he was right, and he reminds me of this fact all the time.
If you’ve been to NEARC meetings you know that there are lots of tasks you can automate, some of which are:Exporting mapsAdding and removing layersUpdating data sourcesChanging symbologyCreating map books
There are lots of reasons that you would want to automate your tasks. Keeps you from doing repetitive workSaves time, and focus for more novel tasksReduces errorI want to focus on these last two reasons:It allows more people to help do the work buy making the work less dauntingIt gives me another way to impose some standards.I would like to show you one of a series of tools I created to address some of the major issues that our office has come across while using ArcGIS.
What do we do?I am a biologist; I work with biologists. We don’t really have IT people who can help us at the day to day level. Map automation with arcpy is pretty manageable (I don’t have a programming background).
What kid of spatial data are we dealing with?
We distribute maps (print and the web) to help illustrate areas that are closed to shellfish harvest as well as the location of sampling stations. Each biologist is responsible for creating maps for the areas that they are responsible for, so they all come out slightly different.Here are a few examples…
Old sampling station map circa 1987 (maps like this are still in use).
Moderately better sampling station map. Most of the items are just drawn on top of a NOAA navigational chart, they are true shapefiles or feature classes.
One of the regulatory maps.
A newer version of the regulatory maps.
Or main problem is that we don’t produce a professional looking product, and it takes us way too long to get mediocre results. But why is it so hard?Colleagues use ArcGIS so infrequently that they have to re-teach themselves every time the open the program. The bottom line is… I need people to be more comfortable with ArcGIS. Once coworkers can comfortably create the maps they need, it will help everything look more consistent and professional. It also frees up my time to deal with larger or more complicated tasks.
Most of my colleagues don't have a very technical background. They have just been given this program and are expected to figure it out for themselves. If you don't have a strong interest and think this sort of thing is "really cool“, it is hard to get over that feeling of intimidation. ArcGIS is very powerful and has so many options. If all you want to do is make a map, the whole thing can be really overwhelming. Our IT department hasn't offered an ArcGIS training class in about 4 years. And seem very disinterested in finding out how department employees are actually using the software.
Make ArcGIS less intimidating. Deal with whatever issues make them think “ugh, this is such a pain.”Getting usable results sooner will encourage future use.Help people get started and be available for questions.Map automation is the answer!
Create custom tools using ArcPy and ArcPy.MappingI think customizing ArcGIS is the answer. Our office needs to produce a variety of maps for printed and web distribution. Arcpy.mapping makes the most sense in dealing with the obstacles we’ve encountered.Limit choices and narrow their focusArcGIS is a very powerful and it’s capabilities are very broad ranging. It is overkill for the average GIS user at DEC. They just need to be able to easily create a few types of projects successfully. You can use script tools to narrow the scope of ArcGIS to be specific to the user.Help them get the desired result on the first tryCreating scripts can help users be more successful. It increases the chance that they will get it right the first time.Explain what you are offering and get feedback to improve itHowever, creating these tools isn't enough. You need to do a bit of training yourself and really make an effort to get that initial buy in. If you don’t get that buy in, you’ve just wasted your time creating all that code, because no one will ever use it.
By creating your own tools and toolboxes, you can make things very familiar.
You can customize the functionality of the user interface with validation scripts:Default valuesDrop down menusEdit the tool metadata to provide specific and customized help text
One of the most common maps we make is a map to show shellfish harvesting closure due to biotoxins (Paralytic Shellfish Poisoning). It is a yearly event on Long Island (although we don’t have it as bad as Maine). We can simplify this whole process
The first task that I wanted to automate was the creation of shellfish closure maps. One of the most common closure maps we make is for biotoxin closures (Paralytic Shellfish Poisoning). It is a yearly event on Long Island (although we don’t have it as bad as Maine). If I were to do this manually, I would have to open the map document, change the effective date, turn layers on and off to export a JPEG and PDF color map, then turn some more layers on and off to export a JPEG and PDF b/w mapI started this last summer, because I had to produce so many of them and they are all basically the same. This has taken a higher priority since I will be on leave during the height of our biotoxin season this coming year.This tool uses pre-authored maps (that I’ve created) and allows the user to edit and export them without having to open ArcMap.
I’ve named the text element “effectiveDate” and I can access that object by using the ListLayoutElements function in the mapping module and update itYou can name each element by opening its propertiesChanges the visibility of certain layers to create the color and b/w versionsAccess each layer using the ListLayers function in the mapping module and change the visibility (Boolean)
I’ve named the text element “effectiveDate” and I can access that object by using the ListLayoutElements function in the mapping module and update itYou can name each element by opening its propertiesChanges the visibility of certain layers to create the color and b/w versionsAccess each layer using the ListLayers function in the mapping module and change the visibility (Boolean)
Unfortunately, we are seeing the organism that can cause PSP in more and more areas on Long Island. The next step is to automate the process of creating a new closure area. What if a new area needs to be closed (that doesn't have a pre-authored map)?Create a new map file from a pre-authored one. This ensures that data frames, text elements, etc. are named properly and will work with the pre-existing tool.
We have similar tools in the works to create other standard maps (conditional shellfishing program, sampling station and regulatory maps).We are also looking into automating some analysis
People in other programs outside of Shellfisheries are also starting to become interested.I don’t think I would have gotten any interest in this without providing regular training opportunities (and offering candy!).Biweekly meetings to demonstrate new tools and get feedback – this really helps gain user buy in!It is important to involve co-workers it gives them a sense of ownership. Co-workers are involved in the process by assisting with the help documentationThe real test will occur next spring when I go on leave.
Learn how to code: http://www.codecademy.comESRI offers about 20 sample scripts to get you startedEach “gist” consists of two parts that you can use to make a script too, the script and the validation script
Please contact me if you have any questions, or suggestions. I don’t get the opportunity to geek out on this at work often, so I would love to talk to you.