Code Monkey home page Code Monkey logo

geopandas-tutorial's Introduction

Introduction to geospatial data analysis with GeoPandas and the PyData stack

Binder

Tutorial on geospatial data manipulation with Python

This tutorial is an introduction to geospatial data analysis in Python, with a focus on tabular vector data using GeoPandas. It will introduce the different libraries to work with geospatial data and will cover munging geo-data and exploring relations over space. This includes importing data in different formats (e.g. shapefile, GeoJSON), visualizing, combining and tidying them up for analysis, exploring spatial relationships, ... and will use libraries such as pandas, geopandas, shapely, pyproj, matplotlib, cartopy, ...

The tutorial will cover the following topics, each of them using Jupyter notebooks and hands-on exercises with real-world data:

  1. Introduction to vector data and GeoPandas
  2. Visualizing geospatial data
  3. Spatial relationships and operations
  4. Spatial joins and overlays
  5. Short showcase of parallel/distributed geospatial analysis with Dask

This repository initially contained the teaching material for the geospatial data analysis tutorial at GeoPython 2018, May 7-9 2018, Basel, Switzerland, and was later updated and also used at Scipy 2018, EuroScipy 2018, GeoPython 2019, EuroScipy 2019.

Installation notes

Following this tutorial will require recent installations of:

  • Python >= 3.5
  • pandas
  • geopandas >= 0.5.0
  • matplotlib
  • rtree
  • mapclassify
  • contextily
  • Jupyter Notebook or Lab
  • (optional for mining sites case study) rasterio, rasterstats
  • (optional for visualisation showcase) cartopy, geoplot, folium, ipyleaflet

If you do not yet have these packages installed, we recommend to use the conda package manager to install all the requirements (you can install miniconda or install the (larger) Anaconda distribution, found at https://www.anaconda.com/download/).

Using conda, we recommend to create a new environment with all packages using the following commands:

# ensure you have at least conda >=4.6
conda update conda
# setting the configuation so all packages come from the conda-forge channel
conda config --add channels conda-forge
conda config --set channel_priority strict
# navigate to the downloaded (or git cloned) material
cd .../geopandas-tutorial/
# creating the environment
conda env create --name geo-tutorial --file environment.yml
# activating the environment
conda activate geo-tutorial

For this, you need to already download the materials first (see below), as it makes use of the environment.yml file included in this repo.

Alternatively, you can install the packages using conda manually, or you can use another distribution (e.g. Enthought Canopy) or pip, as long as you have the above packages installed. In that case, we refer to the installation instructions of the individual packages.

Want to try out without installing anything? You can use the "launch binder" link above at the top of this README, which will launch a notebook instance on Binder with all required libraries installed.

Downloading the tutorial materials

Note: I am still updating the materials, so I recommend to only download the materials the morning before the tutorial starts, or to update your local copy then. To update a local copy, you can download the latest version again, or do a git pull if you are using git.

If you have git installed, you can get the tutorial materials by cloning this repo:

git clone https://github.com/jorisvandenbossche/geopandas-tutorial.git

Otherwise, you can download the repository as a .zip file by heading over to the GitHub repository (https://github.com/jorisvandenbossche/geopandas-tutorial) in your browser and click the green "Download" button in the upper right:

Test the tutorial environment

To make sure everything was installed correctly, open a terminal, and change its directory (cd) so that your working directory is the tutorial materials you downloaded in the step above. Then enter the following:

python check_environment.py

Make sure that this scripts prints "All good. Enjoy the tutorial!"

geopandas-tutorial's People

Contributors

jorisvandenbossche avatar oliverbienert avatar das-g avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.