Render different shape based on categorical field in the dataframe

Hi - I have a use case to render different shapes based on a categorical field in a dataframe at a higher zoom level when the view allows finer details. These shapes have well known meanings in geological engineering standards. At a lower zoom level or at global scale, the different shapes could just collapse into one shape, since at this scale, there will be a lot of data points on your map and the different shapes becomes irrelevant.

Thanks a lot in advance!

This is probably relevant by updating the function and using apply_when

This is really cool! Thanks a lot for the tip.

Is there also apply_when function on hvPlot? I’m using spatialpandas to plot multilinestrings and I’m thinking of using the concept as well switch between datashader and regular plot that allows more interactivity like hover.

hvplot uses holoviews internally so hv.apply_when should work with hvplot (unless it was mutated to panel through some kwargs; check type(obj) to see if that’s the case).