A repository for python gis tools and tricks, as well as a few guides to get people started.
The python programming language can be exceptionally useful, is one of the most common languages used in the GIS community, and is a very suitable first programming language. Nearly everything I know is self taught, and I am NOT a python expert, but have gained a couple of years experience doing python programming for machine learning, data science, GIS, and for general interest. Every once in a while someone asks me a question with a solution that is best demonstrated by example code, and this repository serves as a loosely organized collection of examples and simple tools. Some of these little examples i've writen for myself to reference.
This collection of resources does not attempt to teach basic python syntax, but to serve as a practical resource. There are many online resources for beginners introductions to python including interactive ones on Code Academy, and self paced resources like this one offered by google.
I've decided the best way to approach this is to force users to get established with github and a python interpreter that they can actually grow with in the very beginning. You might not understand why at first, but the instructions are simple enough to follow.
- If you do not already have at least one version of python on your system, get one here.. These resources should be cross compatible with both python 2.7.x and python 3.5.x.
- Create an account here on github. It's easy and free, do it now.
- Fork this repository by clicking the button on the top right of this page. This action will create a copy of this code base just for you, any changes you make can be pushed to github.com under your profile without impacting anyone elses fork.
- Download the github client from here.
- Open up the client, log in with your github credentials, and clone the repository to your desktop computer.
You can do this from the
+
icon in the top left of the client window. Remember the path to this directory. - If you do not already have it, download and install PyCharm community edition from here.
- Open up PyCharm and go to File -> New Project. Create the new project in the same directory as you cloned the repository. Select an interpreter from the dropdown menu of available options.
What you've just set up is an Integrated Development Environment (IDE), which is PyCharm in this scase, Version Control Software (VCS), which is git in this case, and selected an interpreter for your code, which is some version of Python. These are the key elements of developing software, even at the professional level. You've also created a copy of this repository where you can explore the code directly, to use as an example.
Users who are just relativley new to python for gis can follow the topics below, reviewing each topic in order. Otherwise, just go right after whatever you're interested in.
- Obtaining and installing modules
- Flow control
- Functions and Classes
- Heavy math lifting with
numpy
- Data management with
pandas
- Data science with
scipy
andscikit-learn
- Geospatial data manipulation with
gdal
andogr
- Participating in the open source community with
git