Change in rainfall 2001-2016, global tropics

Map: Change in rainfall 2001-2016, global tropics

Python Geoinformatics

Introduction to Python GIS

Python GIS check https://automating-gis-processes.github.io/2016/Lesson1-Intro-Python-GIS.html

The stuff you can do with Python GIS include:

  • Read / write spatial data from/to different file formats
  • Deal with different projections
  • Do different geometric operations and geocoding
  • Reclassify your data based on different criteria
  • Do spatial queries
  • Do simple spatial analyses
  • Visualize data and create (interactive) maps, such as following

Packages

Below we have listed most of the crucial modules (and links to their docs) that helps you get going when doing data analysis or GIS in Python. If you are interested or when you start using these modules in your own work, you should read the documentation from the web pages of the module that you need:

Data analysis & visualization:

  • Numpy –> Fundamental package for scientific computing with Python
  • Pandas –> High-performance, easy-to-use data structures and data analysis tools Scipy –> A collection of numerical algorithms and domain-specific toolboxes, including signal processing, optimization and statistics Matplotlib –> Basic plotting library for Python Bokeh –> Interactive visualizations for the web (also maps) Plotly –> Interactive visualizations (also maps) for the web (commercial - free for educational purposes)

GIS:

pyshp -> Python Shapefile Library

GDAL –> Fundamental package for processing vector and raster data formats (many modules below depend on this). Used for raster processing. Geopandas –> Working with geospatial data in Python made easier, combines the capabilities of pandas and shapely. Shapely –> Python package for manipulation and analysis of planar geometric objects (based on widely deployed GEOS). Fiona –> Reading and writing spatial data (alternative for geopandas).

Pyproj –> Performs cartographic transformations and geodetic computations (based on PROJ.4). For transformation of projections. Mostly unnecessary when using the more conveniant geopandas coordinate reference system (crs) functions.

Pysal –> Library of spatial analysis functions written in Python. The Python Spatial Analysis Library contains a multitude of functions for spatial analysis, statistical modeling and plotting.

Geopy –> Geocoding library: coordinates to address <-> address to coordinates.

GeoViews –> Interactive Maps for the web. Networkx –> Network analysis and routing in Python (e.g. Dijkstra and A* -algorithms), see this post.

Cartopy –> Make drawing maps for data analysis and visualisation as easy as possible. Scipy.spatial –> Spatial algorithms and data structures. Rtree –> Spatial indexing for Python for quick spatial lookups. Rasterio –> Clean and fast and geospatial raster I/O for Python. RSGISLib –> Remote Sensing and GIS Software Library for Python. georasters -> Provides a fast and flexible tool to work with GIS raster files.

rasterstats -> For zonal statistics. Extracts statistics from rasters files or numpy arrays based on geometries.

scikit-image -> Library for image manipulation, e.g. histogram adjustments, filter, segmentation/edge detection operations, texture feature extraction etc.

scikit-learn -> The best and at the same time easy-to-use Python machine learning library. Regression, classification, dimensionality reductions etc.

folium -> Lets you visualize spatial data on interactive leaflet maps.

descartes Enables plotting of shapely geometries as matplotlib paths/ patches. Also a dependency for the geometry plotting functions of geopandas.

xarray Great for handling extensive image time series stacks, imagine 5 vegetation indices x 24 dates x 256 pixel x 256 pixel. xarray lets you label the dimensions of the multidimensional numpy array and combines this with many functions and the syntax of the pandas library (e.g. groupby, rolling window, plotting). Not essential for beginners, but it is a great addition when working with extensive time series data.

seaborn -> Statistical data visualization.

Color ramps

matplot libs colorramps

Resources

x

the “Awesome geospatial” list

Mapping Geograph Data in Python