Learning the Open Source GIS Stack: Python for Geospatial
- Description
- Curriculum
- FAQ
- Reviews
If you are in the field of GIS, you’re probably hearing everyone talking about Python, whether it’s Arcpy in ArcGIS or special Python packages for doing things like geocoding. In this course I am going to show you how to write Python code to perform spatial analysis. The course isn’t so much about learning Python, but rather how to integrate different spatial libraries within your Python code. Using the course videos, you will work alongside of me to learn how I go about cobbling together Python code and various packages to solve spatial problems. I’ll provide you with all the data that I demonstrate in the course.
Of course, we’ll have a brief overview of Python. But after the brief refresher, we will dive into using Python with Open Source GIS and commercial GIS software. Most courses only go over a single GIS program’s use of Python. But in this class, you’ll get exposed to all kinds of different GIS software products, and learn how to tie them all together with Python.
-
2Installing QGIS 3.8
In this section we are going to download QGIS 3.8. If you get a newer version, even better.
-
3Installing Postgres 11
-
4Our data
This lecture is going to give a brief overview of the data we'll be using for our course. Make sure to download the python.zip file, and then unzip it in a folder: c:trainingpython
You'll have to restore the tompkins.backup file into Postgres if you wish to follow along with the coding.
-
5Installing Python 3
There are lots of version of Python out there. I'm using Python 3.7. If you get 3.8 or newer, you'll be just fine.
-
6Loading data into Postgres
Now that the software is loaded, we want to add the Tompkins data set. This lecture will show you how to restore the Tompkins.backup file into Postgres.
-
7The general overview
In this lecture, you'll get introduced to Python as a scripting language. We won't be writing code just yet. For now, I want to describe the many flavors of Python and get you familiar with the interface. Also, I want to give us all a wake up call regarding some of the complexities when working with many different versions of Python.
-
8The Python language: strings
Get ready. We're going to start writing python code - in this lecture, we'll stick to strings. The best thing you can do is follow along with the video, and then replicate the code. By typing it in yourself (rather than copy/pasting from a master copy), you are more likely to really pick up on the language.
-
9Reading and writing from files
So much of what we do with python programming is reading and writing data. In this lecture, we'll read data from a CSV file, and start processing the data. We'll also learn how to write the output into another file.
-
10The Python Language: numbers and lists
In this lecture, we continue our gentle tour of python, and will start introducing examples of numeric data types and functions, and also functions that work with lists.
-
11Statements and control
What makes scripting so powerful is how we can control the flow of the program and the user experience. In this lecture, we'll learn about important concepts like loops and conditional statements.
-
12A simple program to convert temperature
We are going to write a very simple script to convert temperatures. This seems almost juvenile. But, even a simple program for temperature conversion requires us to interact with the user, introduce if/then statements, and also performing calculations. So, its a great jumping off point for the rest of our programming.
-
13Default Python modules
Python has lots of built in functions that allow us to perform mathematical, web based, and file I/O. These modules come with python, and learning to use them will help you more from basic scripting to more intermediate complexity as you solve problems.
-
14Blow your mind with SQLITE
With python, and sqlite package, you can write a python script that will communicate directly with SQLite. That's pretty powerful stuff!
-
15Blow your mind with SQLITE: spatial!
if you thought connecting to SQLite with python was impressive, wait til you see what comes next: adding spatial capabilities to SQLite with Spatialite. And, we can write a python script to not only perform impressive spatial analysis with SQLite, but we can also start interacting with the user.
-
16Numpy
While python has math capabilities, it doesn't come close to the capabilities of using numpy. Numpy is one of the most widely used and respected libraries of scientists who program using python.
-
17Linear Algebra with Numpy (also how to create a function)
Our last lecture introduced some interesting capabilities that numpy performs. For this lecture, we are going to tackle a very sophisticated mathematical concept: linear algebra. Don't panic, we aren't going to go deep. But, you'll see just how easy it is to perform matrix algebra for least squares adjustment - something we do a lot of in geospatial analysis.
-
18Postgres and Python
This is probably what you've been waiting for: connecting to Postgres with python. And, not only are we going to connect to Postgres, we are going to start issuing PostGIS spatial commands to perform geospatial analysis. If you can do this, you are going to get noticed for your superior skills!
-
19Access Microsoft Excel with Python
Not only can you connect to different libraries with python, but you can even connect to Microsoft Excel. And, if you can connect to Excel, you can integrate Excel functions with Postgres functions, with geospatial functions. It's going to start sounding redundant, but if you can do this, you'll really be seen as an expert in python.
Social Network