I've been having a play with the new point cluster renderer in QGIS 3.0.2 and it's great - a lot easier (and faster) than having to do the clustering yourself.
To show what I mean, here's an example of road accidents in Edinburgh using STATS19 data and a 30m radius.
I can't work out how to set up the z-order so that the largest clusters are drawn in front of smaller clusters.
I'm aware of the @cluster_size variable - it's what I'm using to scale and colour the symbols. For this I'm using the size and colour assistants. I removed the font markers to remove the text from each cluster.
Size of markers is defined as follows:-
coalesce(scale_exp(@cluster_size, 0, 50, 1, 200, 0.57), 0)
Colour of markers is defined as follows:-
coalesce(ramp_color('custom ramp',scale_linear( @cluster_size, 0, 50, 0, 1), '#000000')
What I've tried so far:-
- Symbol Levels - No luck; unable to select a variable name.
- Layer rendering > Control Feature Rendering Order and choose @cluster_size as sort. Doesn't appear to have an effect.
- Graduated style using @cluster_size as the expression doesn't work.
Does anyone know if this is possible, or is this a limitation with this particular renderer?
I know there's a lot of other ways to do this (buffer/spatial join, plugins), but the new renderer should be a lot faster. Or have I overlooked something obvious? :)