I have a CSV file with 800 rows and 20 columns that I would like to join with a shapefile (polygon) that has only 10 rows and 1 column (Id).

How should I go about this?

  • 1
    you need to create a join field. a field in both data sources that can be tied together. – NULL.Dude Oct 16 '18 at 12:55
  • Based on your tag of QGIS, here's a tutorial for doing a table join in QGIS: qgistutorials.com/en/docs/performing_table_joins.html – smiller Oct 16 '18 at 13:03
  • 1
    Is this a one:many (1:m) join, in which you would expect the 10 rows in the shapefile to match up with one or more of the 800 rows in the CSV? Or do you only expect 10 rows from the CSV to match with 10 rows from the shapefile? – smiller Oct 16 '18 at 13:16
  • as long as they both data sets have lat long just convert the csv to a shapefile and use the join function in QGIS, there is also an option to convert CSV to a shapefile, I believe. – lewis Oct 16 '18 at 13:41
  • If you do not have lat/lon in your csv, this might be doable with a virtual layer. After you import your csv as table, use the create virtual layer form and write the sql query to join both layers together. – FSimardGIS Oct 16 '18 at 14:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.