5

When joining two files (A.csv and B.shp with a common unique ID) in QGIS the new fields in B.shp (from A.txt) include the name of the field + the name of the file where it comes from (A). For example if we import the field "gender" it will appear in b.shp as A_gender not gender only. Now, the problem comes when the field name es very long because when you save the new joined file (B + A) as a .shp, because it only allows field names with a maximum of 10 characters, the field name is truncated. Any solutions?

  • 1
    Eduardo, in the past, I have simply added new fields to the shapefile with the field names that fit. Joining, then using the joined fields to calculate the corresponding new fields. Not the most efficient approach, but one that works. It'd be great if a field map view could be edited before saving the layer with a join (allowing for field renaming, of course). Similar to a feature class to feature class geoprocess in ArcGIS. – evv_gis Feb 10 '14 at 18:31
2

You can edit how the field names are displayed via the Alias widget. I made Layer A and Layer B (joined to Layer A) both containing a Gender field.

Layer A attributes

And you're right about the new shapefile having a limit of 10 characters in its field names.

Layer A + B

To get around this:

Layer Properties > Fields and input what you want the field to be called in the Alias box.

Field properties

I simply retyped the original name but you can call it whatever you want.

Result

Hope this helps!

Your Answer

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

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