Note
This page was generated from docs/user_guide/interactive_mapping.ipynb.
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
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)
ERROR 1: PROJ: proj_create_from_database: Open of /home/docs/checkouts/readthedocs.org/user_builds/geopandas/conda/latest/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