Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I noticed that after joining a table to a shape file the headers of each fields in the table used for the join are changed by QGIS and they are attributed to a different name. For instance, i had a shape file with vegetation_codes and a table with vegetation_codes and veg_definition (these were the headers). After joining the table to the shape file and also saving the shape file and creating a new one, the vegetation_classes header was changed into vegetati_1. Is there a way to keep the original headers? Notice: i am using QGIS dufour on windows 7 and teh table that i join to the shape file is csv (tried with dbf as well and the problem is the same)

share|improve this question
This very similar questions should serve as a good resource for dealing with shapefile attribute tables (DBF's) and field names. How to bypass 10 character limit of field name in ShapeFiles? – RyanDalton Nov 26 '13 at 1:52

No, you cannot keep the original names. The problem is that DBF files and therefore Shapefile attribute tables have a limit of 10 characters for the column names.

When you join two layers, QGIS constructs new attribute names by combining layer and attribute names of the joined layer. To ensure unique column names, QGIS further adds a running number to the end of the name.

You'll have to rename the columns in the resulting file manually. The Table Manager plugin allows easy renaming.

share|improve this answer
thank you Underdark. I use already that plugin and it is actually very handy. Just a curiosity, do you think that in the future QGIS will be able to keep the headers as they are? If the joined table is large it may take a while to rename the fields. i guess that probably is not a high priority but to be honest an improvement in the join can be very handy and reduce time of the data analysts. thanks – ilaria marengo Nov 25 '13 at 18:42
@ilariamarengo No. QGIS cannot decide to change the Shapefile specification. It is what it is. – underdark Nov 25 '13 at 19:09
OK, I see this point, although if you keep the headers of 10 characters still it would be nice not to have them "renamed" and be in the position of rechanging the names. – ilaria marengo Nov 25 '13 at 19:55
QGIS pre 2.0 did not do any renaming. This resulted in many issues since most layer will have a column "name" and/or "id" and those won't be unique anymore after the join.. – underdark Nov 25 '13 at 20:34
A custom mapping option would be nice though. – Chau Jan 14 '15 at 13:13

I had the same problem and figured out a solution with the 'processing modeler' from QGIS 2.6. Weird enough: in the resulting shapefile, the original columnnames from the .dbf are kept!

How to use the processing modeler?

With the processing modeler you can automate whatever geoprocessing, analysis, datamanagement, etc you do within the usual QGIS environment. In this case I want to join a table to a shapefile and save it as a new shapefile to get an extended attributetabel.

Within QGIS first I have to load a shapefile and the table I want to join with.Then I have to perform that join by entering the Layer Properties and define the joinspecifications under the tab join. Then I have rightclick the shapefile and choose 'save as', fill in a dialogue window and enter the specifications. Then I need to rename all the added fields because they are renamed to obtain unique fieldnames. A lot of work if you have to do a lot of them.

Within the processsing modeler you only have to add these steps once. After saving the model you can easely re-use it.

Enter the processing modeler through processing > graphical modeler


You get something like this

enter image description here

Activate the tab Input as shown above. Double click 'Vector layer', you get:

(afbeelding 3)

Fill in a descriptive name: eg. original shapefile.

Double click 'Table field', you get:

enter image description here

Fill in a descriptive name: eg. Field to join with. The parent Layer is automaticly set because you only have one input added.

Double click 'Table' and give it a descripive name: eg. table to be joined.

Double click 'Table field', fill in a descriptive name: eg. joinfield. Check if the parent Layer is set correctly to the name you gave to the table.

Untill now you only have defined the needed features: shapefile, table and their corresponding unique fields.

Now we have to define the algorithm. Open the 'Algorithms' tab.

enter image description here

Here you find all the scripts an algorithms that are used within the 'normal' QGIS-interface. To easely find the right algorithm, enter a description in the searchfield.


Double click on 'join attributes table'. You get a dialogue window where you have to define the right parameters as shown.

enter image description here

When you enter a name under 'output layer', you will be asked to add a name and location for the new shapefile that will be created.

Press 'ok'.

Now you can see in the right panel the relations between the inputfields, the algorithm and the output.

enter image description here

Give your model a name and save it.

Now you can test the model by running it. Press enter image description here.

Select the shapefile, table and corresponding fields.

enter image description here

Press 'Run' and see if everything goes fine. If not, you can change parameters in the processing modeler and try it again.

The nice thing about the models is that you can run them in batchmode. Open the toolbox ! enter image description here

Right click your model and choose enter image description here

You can now run different joins at the same time.

enter image description here

share|improve this answer
Could you elaborate a bit more on your answer? For some users a screenshot might not be self-explanatory. – gcarrillo Jan 26 '15 at 18:58
@ gcarrillo, I added some more information. It turned out into a very long answer :-) – PieterB Jan 27 '15 at 21:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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