When styling a polygon layer using the Graduated styling and the Natural Breaks (Jenks) mode, QGIS is classifying the data with different values.

So every time I click on "Classify" the values are different.



Using QGIS 3.4.4 on Windows 10

  • I can't reproduce this on Ubuntu 18.04, 3.4.4-Madeira - can you add operating system and qgis version – Ian Turton Feb 11 at 16:54
  • See Edit 1 for the info – Gob Tron Feb 11 at 16:57
  • Using the same dataset, ArcMap complained that the number of features was too big and that I could increase the sample size if I want to. So maybe QGIS is taking a different sample of the data everytime I click on "Classify"? – Gob Tron Feb 11 at 17:02
  • I can reproduce with QGIS 2.18 if there are "many" features. In my test, it occurred when more than 3001 features were to be classified in 5 classes. – JGH Feb 11 at 17:03
  • Testing with 21426 polygon I got the same behavior (different value after each classification), the number of classes didn't matter. QGIS 3.4.1 on window 7 – J.R Feb 11 at 17:11

Looking at the code, QGIS will take the exact values if there are up to 3000 features. Otherwise, it will take the largest between 3000 random features or a random 10% of the data.

  • And if you have for example 4000 features, does QGIS uses 10% of 4000 features (so 400) or it uses up to 3000 features? – Gob Tron Feb 11 at 17:17
  • 1
    it will take the largest between 3000 features or a random 10% of the data – J.R Feb 11 at 17:19
  • Ah! I read it wrong the first time. – Gob Tron Feb 11 at 17:20
  • @GobTron I have clarified it. It will take 3000 random features – JGH Feb 11 at 17:25

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.