I'm working with a considerable amount of points and I would like to be able to display only part of them since they overlap a lot and are cumbersome to display.

enter image description here

Most of them form a trajectory so they don't need to be all displayed, depending on the zoom level it is useful to display let say 1 point every 10.

I looked in to the rendering options, I saw you can light or darken the points but I didn't find something useful.I also saw options to display layers only starting form some zoom level (Scale Dependent Rendering as explained in the doc here, but this needs to create different layers of resolution which is not ideal.

Is there a way to solve this problem in QGIS without needing to filter or process the data points in the database before importing them to QGIS?


Your dataset needs some kind of feature ID, like in this example:

enter image description here

Then you can use a rule using the modulo operator % to fhe features, e.g. every 10th feature only: <theID> % 10 = 0

enter image description here

This is the corresponding rule-based renderer. You can add scales to the rules as well.

enter image description here

| improve this answer | |

A similar idea to Underdark's, but doesn't require a unique field

Adding a unique id is easy with attribute editor and $rownumber, but it can be slow if you're using shapefiles and have lots of points.

Use Rule Based Rendering, and have two rules

[default rule]

Unselect the default rule so it doesn't appear, and symbolise the first rule.

enter image description here

randf(0.0,1.0) generates a random float between 0 and 1.

>.9 will show 10% of your original features. 
>.99 will show 1% of your features

and so on.

The downside to this is that the points will change if you pan or zoom the map.

| improve this answer | |
  • 1
    Thanks, I like this approach as well and for the zoom it's not bad in the end. Actually the best solution would be that when zooming-in, more points appear, like 10% first, then zoom and go to 20%, until 100% to the max zoom. I Think it could be a useful functionality to be implemented in QGIS itself. – Alexis K. Apr 24 '16 at 21:15
  • interesting idea.. there's a $scale which could be used to alter the probability according to zoom level. – Steven Kay Apr 24 '16 at 21:49

Other way, if no field suitable for modulo filter, is create a cluster layer.
There is a plugin: https://plugins.qgis.org/plugins/QgisMarkerCluster/

Then use Scale Dependent Rendering...

| improve this answer | |
  • I've tried the cluster plugin in the past and it didn't perform very well. Has this changed? Does it work with lots of features now? – underdark May 2 '16 at 18:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.