Want to add more attributes in your Shapefile to respective feature? QGIS an open source tool, which I recommend to every Geographer for use, can give you direct solution. Sometimes we need to join more attribute to a GIS vector files which ultimately provide more power to you for analysis with more attributes. For joining two file to add more attribute you need to have a common attribute field in both the files, same as like you need to have primary and foreign key to join two table data in SQL. QGIS provide us the facility to Add more table attributes with joining two files .
You may also be interested to see how to perform Spatial Join in QGIS and other tutorial in QGIS.
Steps to Add table attributes with joining two files in QGIS:
We are performing this steps with Shapefile and csv file, while you can also perform the same steps with other GIS vector file and csv file.
1.) Open QGIS and add a shapefile and observe its attribute table.
Here we have two columns.
Note : Both the field will store in String format as we have not defined the field type. To define field type, create a new file with the same name of that of csv file but with csvt format in the same folder. For above instance the content should be written as :
“Integer”,”String”
in the file. We can see that osm_way_id is the column which is common in attribute table of shapefile and .csv file. So we can join this two using the same.
3.) First we have to import this file in QGIS. QGIS provide us the facility of importing files which do not have any geographic information also. While importing .csv file we have to take care that default type for .csv file is string if .csvt file is not present in the folder.
QGIS will look for .csvt file for data type in the same folder of same name. If not found all the data would be imported as default type i.e String. Now here all the columns are string so we are not creating a .csvt file.
4.) Lets import this file in QGIS. Click layer than Add Layer and select Add Delimited Text Layer.
6.) Click ok. The file is imported.
11.) Click ok.
13.) The tables are joined. Open the attribute table for the layer for which you performed join. The column name Book1_amenity shows that it was imported from Book1.
Comment below if you are facing any problem in adding attributes data to respective features in QGIs with Join function.
It’s really a nice and hluefpl piece of information. I’m satisfied that you simply shared this useful info with us. Please keep us up to date like this. Thanks for sharing.
I tried doing that but the value of join table is null. I don’t know what I did wrong.