I would like to do a very simple task: (1) Add a field to a layer and (2) add some values to the field.
I have ADDED A FIELD TO A LAYER by the following code and created three new fields: Dev_site, Buffer and Unit.
Now I want to add values to the field using python. I searched online and found the field calculator tool:
processing.runalg('qgis:fieldcalculator', input_layer, field_name, field_type, field_length, field_precision, new_field, formula, output_layer).
However, in my case, the field calculator is a little bit advanced. I just want to add some very simple string and number to the field which doesn't need any formula.
Is there an alternative (simpler) way to add values to the field using PyQGIS?