This page was generated from docs/user_guide/interactive_mapping.ipynb.
Interactive online version: Binder badge

Interactive mapping#

Alongside static plots, geopandas can create interactive maps based on the folium library.

Creating maps for interactive exploration mirrors the API of static plots in an explore() method of a GeoSeries or GeoDataFrame.

Loading some example data:

import geopandas
import geodatasets

nybb = geopandas.read_file(geodatasets.get_path("nybb"))
chicago = geopandas.read_file(geodatasets.get_path("geoda.chicago_commpop"))
groceries = geopandas.read_file(geodatasets.get_path("geoda.groceries")).explode(ignore_index=True)

The simplest option is to use GeoDataFrame.explore():

Make this Notebook Trusted to load map: File -> Trust Notebook