I am trying to build a tool in QGIS using a CSV-table with a similar structure as shown below. My goal is to filter the CSV-table for input parameter "category"
and the input parameter "class"
so that receives the distinct buffer distance attribute.
This should be added as an attribute to a vector feature class. So far, I have been unable to find a functionality that can process the non-geodata table to perform this selection.
How could this be done?
1 Answer 1
I've created a model with two input Vector Layers: enter image description here
- First one for the csv file with geometry type =
Geometry Not Required
- Second one for a point layer which should get the buffer value joined to it from the csv file.
To be able to join by two columns I hade to concatenate the category
and class
fields into one column using Field calculator, (Join attributes by field value would not accept two join fields):
I created the fields joinfield
as text type with the calculations concat("category", "class")
.
Then join the bufferdistance field from the csv to the points by the joinfield
.
To get buffer to work I had to use Geometry by expression: buffer(geometry:=$geometry, distance:="bufferdistance")
When you execute the model, Select File
to select the csv file:
enter image description here
I have some points with no match in the csv file, so they are dropped in the join: enter image description here
-
1Yes, exactly the solution I was looking for! Thank you so much!LuckyLeu49– LuckyLeu492024年12月07日 23:34:30 +00:00Commented Dec 7, 2024 at 23:34
Explore related questions
See similar questions with these tags.