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
136 Apia POINT (-171.76860 -13.83571)
50 Lusaka POINT (28.28138 -15.41470)
144 Hanoi POINT (105.84807 21.03527)
118 Tirana POINT (19.81888 41.32754)
181 Caracas POINT (-66.91898 10.50294)
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).