Holoviews performance when plotting geographical data

Hi Everyone,

I’m looking to create some choropleth charts using NHS CCG shape files link below:

I’m using the ultra generalised file as it is the smallest file I can find.

To this shapefile I am adding one column of data against each CCG and plotting it, dependencies below below:

import pandas as pd
import numpy as np
import geopandas as gpd
import holoviews as hv
import matplotlib.pyplot as plt
import matplotlib
import hvplot.pandas 
import cartopy.crs as ccrs

pd.options.plotting.backend = 'holoviews'

To which after creating a geodataframe together and merging the one column I need, I plot with the following:


However, when I plot the data which is 3 columns x 216 rows:

  • 1st column = 'CCG Name’from the shapefile

  • 2nd column = ‘Geometry’ from the shapefile

  • 3rd column = ‘Status’ the column i have added, which against each ccg indicated a colour status (e.g red, blue, grey)

However, when viewing the plotted data the performance of Holoviews when displaying the chart is really poor. It becomes really laggy when hovering over the data and consumes a huge amount of memory.

I have tried using Geoviews to the do the same plot but keep running into projection errors, which i have tried reprojecting to the correct projection method to fix, but it still doesnt seem to work for me.

I was wondering if anyone knows what I could possibly be doing wrong? I’ve seen examples of people using hv.plot() for geographic data and it looks really awesome and performance seems great (same for GeoViews). Any insight would be really appreciated! Could it be that i’m just working with a bad shapefile?

Kind regards