Introduction to Coding using Python

Nowadays, being efficient and creative in GIS/ci often involves being willing to experiment with code. There’s a lot of GIS that only exists in ‘libraries’ (akin to collections of ArcGIS tools) and a lot more that is possible once you can remix existing code and use it alongside GIS GUIs. This is not the same as software development–you’re not necessarily developing something general for others to use, you’re often solving a particular problem for an organization or yourself. This sort of knowledge of code for GIS and cartography even isn’t the same as learning code in the context of data science with aspatial types of data, as most data science courses are. There are overlaps with software development (or theoretical computer science) that you might get in a computer science department, and there are overlaps with what you might learn in data science. But there’s a lot that’s specific to GIS and the GIS community, and plenty of people who are successful in using code in GIS are even self-taught. Regardless, it’s a never-ending pursuit for anybody, as things always change, and ‘mastery’ is impossible–one builds up experiences and analogies and, above all, a willingness to experiment. In this lecture, we’ll build on the experiences you’ve had with ArcGIS Notebooks during the course, giving you a basic sense of some uses of code within GIS, focusing on Python and ArcGIS as someone doing GIS analyses might experience.

Learning Objectives

  • To be able to articulate some situations in which coding might be useful within GIS/cience.
  • To understand some of the ways that Python integrates into ArcGIS and other GIS GUI software platforms.
  • To be aware of Python's data wrangling, visualization and spatial data engineering capabilities.
  • To get a sense for ways in which one might pursue adding more code to one's own work.

Required Readings

Here are some slides that outline why Python, and programming in general, are becoming / have become so integral to GIS.

Resources

Here are some useful resources which you could come back to after the course (or perhaps in your projects). Here are the 'top three':

There are also collections like the Whitebox Workflows for Python.

Beyond that, if you want more basics that are not specific to GIS, one can go to the source--Python.org--and find a long listing of python tutorials, both written and video.  The many videos produced by Christian Thompson are easy-to-follow introductions to various aspect of python (sorry about the ads that jump into the fray). A four-hour long video from FreeCodeCamp is also well reviewed. Taking UBC's CPSC 103 would also be a way to engage such issues in more depth and structure.

For those who want more general data analysis understanding, the videos associated with PyData might be worth viewing. They cover a variety of topics in data science, cleaning and tidying data in Pandas, and more. Here, one might consider a course such as UBC's DSCI 100 for a more structured introduction.

Cheatsheets include:

(You can search to see if there is a cheatsheet for a different platform you are interested in or a newer version of one above)