Note

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:

[1]:
import geopandas

nybb = geopandas.read_file(geopandas.datasets.get_path('nybb'))
world = geopandas.read_file(geopandas.datasets.get_path('naturalearth_lowres'))
cities = geopandas.read_file(geopandas.datasets.get_path('naturalearth_cities'))
ERROR 1: PROJ: proj_create_from_database: Open of /home/docs/checkouts/readthedocs.org/user_builds/geopandas/conda/stable/share/proj failed

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

[2]:
nybb.explore()
[2]:
Make this Notebook Trusted to load map: File -> Trust Notebook