1

I would like to classify several values from a vector table with field calculator in 5 classes based on standard deviation. Example: value = 3.3, mean = 2.5, std deviation = 0.7 and class #5 is "mean+std dev and above", than his new value is 5 (new column)

It seems pretty easy to do with a CASE ELSE statement in QGIS, but I would like to write something that I can use for several SHPs with different means. I was looking for some help here to simplify the statement so it can be easily re-usable with a new and different shp.

  • These values are always same? – luca76 Jun 11 '15 at 7:49
  • Could you add the code you have so that others can have a better idea on how to help please? :) – Joseph Jun 11 '15 at 9:10
  • This is the script : CASE WHEN "Rend_Mass_" < '2.59' THEN 1 WHEN "Rend_Mass_" < '2.91' THEN 2 WHEN "Rend_Mass_" < '3.24' THEN 3 WHEN "Rend_Mass_" < '3.56' THEN 4 WHEN "Rend_Mass_" > '3.56' THEN 5 END I calculated the values for the classification, but I'd like something more generic (ex : when "Rend_Mass_" < x-a then 1, where x=mean and a=std dev) so I can just plug the values for x and a and generate Classes. IT works, but I have a lot of shps to process with different values of "rend_Mass_", so different means and std dev. See below... – AGR Jun 11 '15 at 14:35
1

This is the script : CASE WHEN "Rend_Mass_" < '2.59' THEN 1 WHEN "Rend_Mass_" < '2.91' THEN 2 WHEN "Rend_Mass_" < '3.24' THEN 3 WHEN "Rend_Mass_" < '3.56' THEN 4 WHEN "Rend_Mass_" > '3.56' THEN 5 END

I calculated the values for the classification, but I'd like something more generic (ex : when "Rend_Mass_" < x-a then 1, where x=mean and a=std dev) so I can just plug the values for x and a and generate Classes.

IT works, but I have a lot of shps to process with different values of "rend_Mass_", so different means and std dev.

enter image description here

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.