Higher Education

Teaching Programming for GIS, Part 1

University GIS instructors often ask Esri employees for advice on what “industry” expects their students should know, what are the latest trends, etc. Even though most responses will start with “Depends on . . ., ” in the end, coding or programming will surely be included. As David DiBiase showed in 2017, GIS graduates often regret not having learned more programming skills. Modern GIS users are programmers. The ArcGIS system is multifaceted and loaded with toolbox functionality, but there is always something that ArcGIS users would like to automate (“let’s repeat that transformation process on all my similar files”) or extend or connect to. That involves scripting, more than heavy programming or software development per se, and scripting often means using Python.

One of the huge strengths of the Python language is its universality, unlike previous proprietary GIS-centric languages that will go nameless. Python has become the lingua franca of many scientific and engineering workflows these days, making Python skills not only useful but also very marketable in terms of career opportunities. Northeastern University recently published a blog about the 10 most popular programming languages, and Python came out on top. As the image below shows, Python has had an increasing role inside ArcGIS since 2010.

Snippet from Shaun Walbridge’s presentation at the 2021 Esri Developer Summit, showing the history of Python inside ArcGIS: a decade and counting.

So if one of the answers is clearly that students should learn Python and its related scripting capabilities, some then might ask, Exactly which parts or flavors or workflows of Python should be taught? This is where opinions diverge. There are many options to choose from, and I should say that when I contacted various people on Esri’s Python teams–yes, there are several—there was not a consensus either on what they use internally or what they expect from graduates they hire. There is certainly a tendency toward the use of Python notebooks, and we will cover notebooks in more detail in a future blog post. The good news today is that Esri offers a wide array of tutorials, examples, Learn lessons, etc., such that help is available no matter which option you choose.

10,000 Hours

You may have heard about the theory that a person needs around 10,000 hours of experience to become an expert or a virtuoso in any field, be it piano or marathon running or programming. This idea was popularized by Gladwell’s 2008 book Outliers. But in a widely viewed TED talk, Josh Kaufman challenged that theory by claiming that most of us do not aim to win the Boston Marathon when we start jogging. He showed that the “first 20 hours” of becoming minimally skilled in something is also very useful. In around 20 hours, you can go from falling down to skiing, from making only noise on a guitar to learning the basic chords, and from zero to programming “Hello, World!” on a computer. To me, the key to success in Python programming as a GIS user is the dedication one makes to proficiency.

Programming languages are somewhat like natural languages, so just like you need to really immerse yourself in French if you want to become fluent–meaning, when you go to France you can converse with natives—if you want to be productive as a Python scripter, you also need to put in the hours. But probably not 10,000 hours which is equivalent to about five years of full-time employment. On the other hand, students probably need more than the 20 or 50 hours they might get in a single GIS programming course. The Esri Python specialists I spoke with were not concerned about which flavor of Python experience potential hires had but cared more that they had some real programming experience in the trenches. Much of the programming workflow involves messy parts such as wrangling data and fixing bugs in your program code. Learning to be comfortable and efficient at those parts takes time. We learn by applying patterns (“that looks like a systematic error, not a blunder”) from our past experience to the new problem being solved.

The Programming Instructor

If increasing programming hours is important, another important factor is the profile and experience of the people who are teaching GIS programming. Instructors will also have their own flavor of Python abilities, previous experience, and teaching style. Since there is no single prescribed way to extend GIS via Python each instructor will teach what he/she normally uses or what his/her own professor taught previously.

We see a tendency in GIS graduate programs of hiring practitioners from industry or government as adjunct instructors to teach GIS programming courses. Or university instructors from a Computer Science department or related Data Science field might be brought in. This makes sense in cases where otherwise strong GIS instructors are not regular programmers themselves and cannot easily ‘do the hours’ previously mentioned and that would be required to update themselves.

Greg Brunner is a good example of such an industry adjunct. Greg is Data Science Team Lead at Esri and teaches Advanced Programming for GIS and Remote Sensing at Saint Louis University. He is also the author of the Python programming Path using ArcGIS Notebooks, available to all at Esri’s learn.arcgis.com site. Greg tells us that he teaches the tools and methodologies he uses every day at his day job. Other fulltime instructors may wish to introduce their research project-based programming into class exercises. The key is to show real workflows and not just a disconnected collection of exercises.

Getting started with Python

Before jumping into the use of Python with ArcGIS a prerequisite for many novice students might be basic Python online courses. Here are just some of the many available courses. This level-setting will make it easier to maintain a reasonable pace in the GIS programming classes, although many instructors also find it useful to offer normal and advanced class exercises so that each student can find her/his own level and feel challenged.

The search for resources for learning and using Python in ArcGIS can be confusing: there’s just so much out there but some may be outdated or not relevant to the level, subject matter, or programming environment you prefer. The following resources are recommended places to start.

The two new (2020) books from Professor Paul Zandbergen provide a nice collection of exercises on Python scripting in ArcGIS Pro including geoprocessing tasks with ArcPy. Additionally the process of learning to program or script can be enhanced by studying other people’s code, and GitHub has become one of the primary code repository portals for doing just that. Esri employees and customers have published and shared hundreds of code repo’s at the link below, and one can easily filter the content, on Python in this case.

Click on that graphic to go to the Esri GitHub page with more than 30 Python-related code repositories.

You might be wondering, what about programming for the web? That involves mainly Javascript programming know-how. Javascript is number 2 on the Northeastern University top-10 list and is the topic of the next blog post in this series, coming soon.

For an in-depth analysis of programming in Geography academic programs, see the excellent article by Forrest Bowlick, Sarah Bednartz, and Dan Goldberg in The Canadian Geographer / Le Géographe canadien 2019, pages 1–17. DOI: 10.1111/cag.12544

About the author

Michael Gould received his doctorate in Geography from University at Buffalo and then crossed over and is professor of Information Systems at Universitat Jaume I in Spain. He joined Esri in 2009 and has worked primarily on international education projects in collaboration with universities and Esri’s more than 80 regional and local offices around the world. He can often be found traveling (in normal times) or mountain biking.

Connect:

Next Article

Imagery Summit Recap: A Panoramic Perspective

Read this article