3

I am using QGIS 3.4.1-Madeira.

I have a base layer map that represents areas as polygons. I have created a CSV file with many entries of different NGO projects, and each one is coded with the ID of the spatial area it takes place. I understand I can't do a simple Join because it only joins one row of the CSV to each area polygon. I have set up a Relation in the Project Properties, which reflects the data structure I want, but I can't figure out how to make it just display in the map as a new layer.

2
  • As far as I can see, shapefiles can store only 1:1 relations and a clean way to realize a one to many relation is using some database format, e.g. spatialite and store both tables. Unfortunately a related table, like in the ESRI-world, has no equivalent in a database. Dec 4, 2018 at 9:49
  • you should read about virtual layers concept of QGIS, it offers a lot of possibilities known from databases like joining data and building new layers based on that join. Just as a starting point (the concept is the same in QGIS 2.18 and 3.4): docs.qgis.org/2.14/en/docs/user_manual/working_with_vector/…
    – eurojam
    Dec 4, 2018 at 17:29

1 Answer 1

3

Let me suggest Join attributes by field value tool (though I am conscious this is not a direct answer to your question: how to utilize your established Relation).

This tool joins two tables using key field from each table. Its Create separate feature for each matching feature (one-to-many) option allows us to create one-to-many relational table, extending (duplicating) one record to match with many other records in the other table.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.