I’m looking for a way to do the following in a Python script in QGIS. I have multiple shapefiles (shape_x.shp, shape_y.shp, shape_z.shp) and a CSV table which is structured like the following example:
Now I want the values value_a, value_b and value_c to be written to a new column in the respective shapefile. This is not particular a classical table join, because all the features from the shape should get the same value. So, there is no need for a common column.
The attribute table of the shape_x.shp might look like this before the data is added:
…and a knew column, based on the value of the CSV, should automatically be added, so that the attribute table of the shape_x.shp afterwards looks like this:
The different shapefiles have a varying number of features, so no matter how many features, the value from the CSV should be added as a new column to every feature.
I hope I made the problem clear. I searched for automatically adding data to shapefiles and any kind of join (like this example), but no success so far.