4

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?

example of used "Database" table

Taras
35.7k5 gold badges77 silver badges151 bronze badges
asked Dec 6, 2024 at 7:19

1 Answer 1

4

I've created a model with two input Vector Layers: enter image description here

  1. First one for the csv file with geometry type = Geometry Not Required
  2. 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

answered Dec 6, 2024 at 8:23
1
  • 1
    Yes, exactly the solution I was looking for! Thank you so much! Commented Dec 7, 2024 at 23:34

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.