This is a quick overview of essential Python libraries for working with geospatial data. What I think might be valuable for newcomers in this field is some insight on how these libraries interact and are connected.

Shapely and Geopandas

When dealing with geometry data, there is just no alternative to the functionality of the combined use of shapely and geopandas.

With shapely, you can create shapely geometry objects (e.g. Point, Polygon, Multipolygon) and manipulate them, e.g. buffer, calculate the area or an intersection etc.

Shapely itself does not provide options to read/write vector file formats (e.g. shapefiles or geojson) or handle projection conversions. This can be handled e.g. with the Fiona library. But there is an even more convenient way:

Geopandas combines the geometry objects of shapely, the read/write/ projection functions of fiona and the powerful dataframe interface of the pandas library in one awesome package. In the spreadsheet-like dataframe, the last column ‘geometry’ stores the shapely geometry objects, all shapely functions can be applied. The pandas mechanics offers super easy ways to manipulate, plot and analyze the data, e.g. dataframe groupby operations etc.

Rasterio

Rasterio is the go-to library for raster data handling. It lets you read/write raster files to/from numpy arrays (the de-facto standard for Python array operations), offers many convenient ways to manipulate these array (e.g. masking, vectorizing etc.) and can handle transformations of coordinate

reference systems. Just like any other numpy array, the data can also be easily plotted, e.g. using the matplotlib library.

GDAL

Although I rarely use GDAL functions directly and would recommend beginners to concentrate on rasterio and shapely/geopandas, the Geospatial Data Abstraction Library needs to be on this list. Many of the libraries which are described here rely on GDAL, it is the cornerstone for reading, writing and manipulating raster and vector data in many software packages. However, the GDAL Python bindings (GDAL is originally written in C) are not as intuitive as expected from standard Python. The other libraries on this list use modern Python language features and imho offer more convenience and functionality.