Clustering point layers

“Cluster Points conducts spatial clustering of points based on their mutual distance to each other.”

Point cluster renderers are used frequently in web mapping applications to condense multiple overlapping or nearby points into a single rendered marker for clarity. The clusters that are generated shows the number of items in each cluster, and as a user pans the map the clusters adjust based on the view. This makes it more efficient to render highly condensed data and easier for users to understand the map.

You try:

Goal: To classify condensed point layer using Point Cluster

  • Load the exercise data into QGIS.
  • Pan around the map canvas and also open the attribute table to see how many features are in the point layer.
  • Navigate to the symbology section for the point layer.
  • Change the classification to Point Cluster. Leave all other defaults and observe the symbology for the layer.
  • Navigate back to the symbology of the layer and change the render to Categorized. Change the settings and use the column continent to classify it.
    To Do
  • Play around with the distance setting increasing it and decreasing and note what happens to the clusters.
  • Whilst changing the distance note the units of measurements and how they influence the clusters.
  • Also change the projection of your map to EPSG:6933 and experiment with the measurements in meters or km.

More about point clusters

When using point cluster it draws the points in a cluster with each cluster labeled with the number of features. The point cluster uses a point distance tolerance to determine the proximity of features that can be grouped together. If the point has no neighbors it will be drawn using the default symbology of that point feature. Point clusters also support the following symbolization.
1) Single Symbol
2) Categorized render
3) Rule based render
4) Graduated render

Point clustering also supports using expression variables to achieve data defined symbol overrides for the cluster symbol.
@cluster_size: this will be set to the number of points contained within the current cluster. This variable could be used to scale the size of the rendered cluster marker, or used along with the font marker symbol to draw the number of clustered points inside the cluster marker, or even used with the ramp_color function to vary the color of the symbol.
@cluster_color: if all points contained within the current cluster share the same symbol color (ie, if they are from the same category class or graduated range), then the @cluster_color variable will be set to match this color. If the points are from mixed classes then @cluster_color will be null. This variable can be used along with data-defined colors to alter the appearance of a cluster to inherit the same color as the symbols contained within the cluster.

NB: Point cluster only works with single point geometry. If you have a multipoint table you will have to convert it to a single geometry type in order to use this render.

Check your knowledge:

  1. Which of the following statements is true:
    1. Point clustering is a spatial operation
    2. Point clustering is only useful when the point layer contains numeric values in the attributes
    3. Point clusering is a technique that enables densely clustered point to be easily visualized
  2. Point clustering can not be used in conjuction with which render:
    1. Rule Based render
    2. Categorized render
    3. Graduated render
    4. Heatmap render

Further reading:

Click here to download the sample data for the lesson.