Points#

Download this notebook from GitHub (right-click to download).


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)
name geometry
153 Warsaw POINT (21.00535 52.23087)
98 Guatemala City POINT (-90.52891 14.62308)
228 Nairobi POINT (36.81471 -1.28140)
241 Singapore POINT (103.85387 1.29498)
6 Majuro POINT (171.38000 7.10300)
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)
This web page was generated from a Jupyter notebook and not all interactivity will work on this website. Right click to download and run locally for full Python-backed interactivity.

Download this notebook from GitHub (right-click to download).