Geopandas introduction

If you are data analyst or data scientist working with python, then probably you are already familiar with pandas, but if you are entering a spatial domain data analytics you should check out GeoPandas. It extends panda’s capabilities by adding spatial operations and geometric types. In this blog I will focus on two aspects of GeoPandas: visualization and simple spatial analytics.

Let’s start from notebook output area setup, so that we can see the entire map, without vertical scrollbars.

Data used in this post is open source and comes from envirosolutions web page. Similar to pandas, geopandas allows you to easily read and write from spatial formats like: Shapefile, GeoJson, postgis. It is mostly achieved thanks to Fiona which is used here, similarly like Shapely (used for geometry format storage and spatial data analytics) or matplotlib (used for data visualization).

First method for geometry display is using matplotlib.pyplot, which was already disscused in this post : Matplotlib: Lines, bars, pie charts and some other stuff

Other option for geometry display is interactive map based on folium/leaflet.js, here you can easily display your geometry with underlying layer (i.e map or aerial imagery)