Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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
1  
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

1 Answer 1

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
2  
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

Your Answer

 
discard

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.