I'm trying to calculate and output a virtual field -- something that is a straightforward function of fields from a vector layer in QGIS 3. The FieldCalculator does the trick, but I need to manually specify parameters (e.g. coefficients in the function).
That's easy via FieldCalculator, but if I want others to use this calculation, what's the easiest way to prompt the user to input parameters?
A plugin seems like overkill for something this simple.
1 Answer 1
You can use the QGIS Model Designer for that, which is a powerful tool to make input dialogs for such tasks. Also the field calculator is available within the Model Designer:
The example above takes a vector layer and two numerical inputs and makes the sum of the two numerical inputs and write it into the field NewField, not very complex but shows the possibilities:
here is is a small video which explains the steps above: https://files.wheregroup.com/index.php/s/dKnZRibgymAe6oM
-
This looks like a great way to go, but I am having trouble A) understanding how to wire up the components, and B) finding time over my last few days crises to get it working. Any pointers to "how to's" or other such things would be greatly appreciated.Frank Horowitz– Frank Horowitz2020年12月20日 00:41:43 +00:00Commented Dec 20, 2020 at 0:41
-
I added a link to a small video to the post above, hope this helpseurojam– eurojam2020年12月20日 18:33:11 +00:00Commented Dec 20, 2020 at 18:33
Explore related questions
See similar questions with these tags.