
In this section we are going to download QGIS 3.8. If you get a newer version, even better.
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:\training\python
You'll have to restore the tompkins.backup file into Postgres if you wish to follow along with the coding.
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.
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.
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.
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.
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.
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.
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.
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.
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.
With python, and sqlite package, you can write a python script that will communicate directly with SQLite. That's pretty powerful stuff!
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.
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.
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.
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!
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.
In this lecture, you will learn how to import the formlayout package and start shaping the structure of a GUI with python. This is not a sophisticated for editor, but it is really easy to use, and very likely can handle 80% of what we need in the form of a GUI.
In this lecture you'll see how we extend the simple form we previously created to integrate ArcGIS with Arcpy and formlayout. In this case, you can start creating forms for ArcGIS applications, without the need to use ArcScripts.
Now we are going to expand our use of forms to Postgres! In this lecture, you'll learn how to create interactive forms with the user, and connect those forms with Postgres, allowing you to issue SQL and spatial SQL however you feel. You'll also notice that the codes is short, light weight, but very interactive. This will prove that you can create a Postgres/PostGIS form in a matter of minutes.
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.