import hvplot.pandas # noqa
Using hvplot with geopandas is as simple as loading a geopandas dataframe and calling hvplot
on it with geo=True
.
import geopandas as gpd
cities = gpd.read_file(gpd.datasets.get_path('naturalearth_cities'))
cities.sample(5)
cities.hvplot(geo=True, tiles=True)
You can easily change the tiles, add coastlines, or which fields show up in the hover text:
cities.hvplot(tiles='EsriTerrain', coastline=True, hover_cols='all')
We can also alter the projection of the data using cartopy:
import cartopy.crs as ccrs
cities.hvplot(coastline=True, projection=ccrs.Geostationary(central_longitude=-30), global_extent=True)