Skip to content

stijnvanhoey/course_gis_scripting

Repository files navigation

Introduction to scripting GIS analysis

Introduction

These course notes provide an introduction to the usage of Python and R for GIS procedures. The course notes were developed for a hands-on session at the Institute for Nature and Forest Research (INBO), May 2017.

The course can be split up in three main sections:

  1. Introduction to (scientific) Python: crash course introduction to the Python standard library and some essential scientific Python packages (Numpy/Pandas). Still, for a more extended introduction course of (scientific) Python, check these course notes providing a more extended Python introduction.
  1. Introduction to Python for GIS: Introduction to some essential vector and raster packages in Python, such as geopandas, fiona, rasterio, ...
  1. Introduction to R for GIS: introduction to some essential vector and raster packages in R, such as sp, raster, ggmap, ...

The course notes for the hands-on sessions are available in the notebook folder. For the Python sections, Jupyter notebook is used, while the R course material is available as Rmarkdown notebook files. Check the Github page for the slides. The individual presentations (stored in the docs folder) can be used as guiding presentations to explain the setup and flow of the course. Specific focus is given to the interaction of both languages to the OSGEO libraries (proj.4, geos and gdal), which has been illustrated hands-on o the command line during the course.

Running the course material

Python

The Jupyterhub infrastructure described in the setup of the Python-slideshow has been setup and running for the course sessions at INBO itself. Hence, it is not available as a continuous service. Still, the working Python environment can be setup locally as well, as discussed below.

By installing the Anaconda or Miniconda Python packaging environment, the required environment can be setup using the environment.yml file. To setup the environment, use the Anaconda navigator tutorial or define the environment with the command line:

conda env create -f environment.yml

After activation of the environment (select the environment in Anaconda Navigator, activate gispython (windows cmd) or source activate gispython (linux terminal)), start Jupyter notebooks to work on the Python notebooks. Startgin Jupyter notebook can be done directly from the Anaconda Navigator by command line:

jupyter notebook

Remark: If the usage of the environment file does not work, setup your own environment or install the most essential packages in your current working environment using conda: conda install pandas numpy geopandas rasterio mplleaflet. This will support most of the course material.

R

The easiest way to start working on the Rmarkdown files is by using Rstudio as this IDE fully supports the Rmarkdown format. By running the first cells of the 07-gis-r-vectors.Rmd notebook, the required dependencies will be installed.

Acknowledgements

These course notes are highly inspired by some interesting other sources:

About

Introduction to scripting in Python/R for GIS analysis

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages