50

I have a CSV file which has postcode data in a field, but it is non-spatial e.g. no Easting and Northing.

I have a shapefile with postcode in a field and some additional data.

I want to join the CSV with the shapefile based on attributes (postcode fields). I know I can do this in ArcMap, but how can I achieve the same thing in QGIS?

3
  • How do you do this in version 2.3.0-Master?
    – user30210
    May 13, 2014 at 18:47
  • In version 2.8 (and with some earlier versions previously too) I cannot make this work. Trying to join matched on UK postcode data. Using mmqgis I get an error "no geometry in Postcode layer" or something very similar. Using the QGIS join function I get a join of the data but no geometry added to the CSV. Very very frustrated with this issue. Apr 16, 2015 at 16:23
  • 1
    Hi @Rostranimin. Are you doing it the right way, i.e. joining the CSV data to the shapefile data, from the shapefile "Properties" dialog?
    – stragu
    Aug 7, 2015 at 10:06

4 Answers 4

42

The upcoming release of QGIS version 1.7 will have a join feature built into the layer properties. The speed of joins is also quite impressive.

Steps to join:

  1. Open csv via the open vector icon.
  2. Open properties tab on the layer you want to join onto (your map)
  3. Click the Join tab and press the + button
  4. Select the csv layer and the two columns that you want to join on.
  5. Hit ok in the properties dialog.

Join in QGIS

3
  • Nice. Adding csv files using the Add Vector layer is not intuitive though. I wish I knew this earlier.
    – R.K.
    Mar 13, 2012 at 14:27
  • 1
    Four years later and this still doesn't work as reliably as the MMQGIS plugin IME.
    – camdenl
    May 7, 2015 at 18:38
  • 1
    This was much faster than the MM plugin. To add the data layer, use layer-->add delimited text->csv Aug 27, 2015 at 23:41
33

A quick way is to use the "MMQGIS plugin" which will join your CSV file to the shapefile by postcode fields

enter image description here

6
  • 4
    Hey look! There is my File Browser plugin :D
    – Nathan W
    Feb 22, 2011 at 22:41
  • 1
    Good Work Nathan - been using it lots, works well.
    – Mapperz
    Feb 22, 2011 at 22:42
  • 1
    This is working well, just what we needed. Big thank you!
    – gisuser
    Feb 23, 2011 at 10:49
  • hi, I try to do that but I get the following error Traceback (most recent call last): File "C:/Users/Juan/.qgis/python/plugins\mmqgis\mmqgis_dialogs.py", line 65, in browse_infiles dialect = csv.Sniffer().sniff(infile.read(1024)) File "C:\PROGRA~1\QUANTU~1\apps\Python25\lib\csv.py", line 160, in sniff raise Error, "Could not determine delimiter" Error: Could not determine delimiter
    – user3232
    Jun 5, 2011 at 23:36
  • @Carlos: Which delimiter do you use in the CSV file?
    – underdark
    Jun 6, 2011 at 8:55
0

If you load your data into MS Access, ftools will allow you to join with an MS Access table.

You start qgis plugin installer, enable 3rd party repos and ftools will become available.

then use the plugin tool by going to fTools > Data Management tools > Join Attributes

1
  • Thank you, I don't particularly want to use another programme to get there but I will try this if all else fails.
    – gisuser
    Feb 23, 2011 at 8:55
0

The fTools plugin for working with Vector data will also give you the same option to "join data on an attribute" even if it's non-spatial.

1
  • It only seems to use the spatial data as the target layer, in this case I would like to add the fields from the spatial layer to the csv. Thanks for the suggestion.
    – gisuser
    Feb 23, 2011 at 8:54

Your Answer

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

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