7

I am using the expression presented by the user JGH to solve the question 'Point Clustering in QGIS, but values show a percentage and not count of points'

This shows my example:

enter image description here

As you can see I use the same expression of the percentage labeling to control the circle size of the Point Cluster render.

I would like to build an expression applied to a circle symbol that substitutes the circle symbol for the convex hull or concave hull geometry that operates with the Point Cluster render algorithm used to calculate the groupings of the points in each cluster.

Here is a simulation screenshot of what I am looking for:

enter image description here

The goal would be to use the Geometry Generator to change the circle symbol for a convex hull geometry that visualizes the grouped points inside every cluster. My initial approach is based on the following attempted solution, which involves trying to interfere with the Point Cluster symbol using the @cluster_size parameter, but still doesn't work:

convex_hull( 
    collect(
       $geometry, 
       group_by:=overlay_nearest(@layer,$id,filter:=@cluster_size))
       )

In summary, I ask myself if it is possible to subdivide and make groups of convex hull geometries based on the internal identifiers of the Point Cluster render?

enter image description here

3
  • 2
    Using the cluster size will likely be inadequate, see this post. You may have to create the clusters via geoprocessing instead of styling.
    – JGH
    Commented Sep 28, 2023 at 11:55
  • Thank you very much for sharing this post. I had not found it before. It is very useful! to understand how the Point Cluster render works. I am aware that this problem may not be solved with styling Geometry Generator, however my goal is to avoid the pre-geoprocessing step of cluster calculation in order to make the solution work in real time. Would there be any solution focused on creating a Virtual Layer that accomplishes this goal? Commented Sep 28, 2023 at 12:08
  • 1
    I doubt via a VL, but if you have access to Postgis you could create a view that does the clustering + compute centroid + generate convex hull
    – JGH
    Commented Sep 28, 2023 at 12:23

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.