I'm just beginning with QGIS.
I have a shape file with 10 fields field1, …, field10, and many thousands of data.
I will like to automatize the next sequence (in a python script or a model):
- load the shape file
- create a field field_add defined as
field1 + field2
- value in field3 is Text1, Text2, Text3 or Text4 (
if Text1, coeff=a; if Text2, coeff=b; if Text3, coeff=c; if Text4, coeff=d; else coeff=e
) - create a field field_age defined as
field4 * coeff
- create a field field_result defined as
field_age^m * field_add^n
- create a field field_class defined as
1 if field_result < floor1, 3 if field_result > floor2, else 2
.
After that, I will visualize each polygon with its field_class color (white for 1, green for 2 and red for 3).
All the coefficients (a,b, c, d, e, m, n, floor1 and floor2
) have to be changed quickly, to update the chart.
I insert part of the table:
Please, could anyone indicate to me the best way to proceed?
Best Answer
So, for the first python script for QGIS, I have:
It's what I want for this first use of QGIS python script.