Take the 2-minute tour ×

How might I go about exporting a polygon shapefile (e.g. CSV) so that attributes (not geometry) are editable by others, and importing it with the changed attributes (of which there are several columns worth)?

I tried the mmqgis plugin (Transfer > Attributes Export/Join to/from CSV file), but
1) it seems to only be able to import one attribute at a time and
2) creates a separate temp.shp without geometry and
3) does not attach the new attributes to the existing polygon shapefile.

Is there something I'm doing wrong here, or do you have a better solution for my task at hand?

attributes polygon qgis


share|improve this question
You need a unique id to match your csv to the polygon attributes (they need to match correctly) –  Mapperz Oct 5 '12 at 17:38
"shapeid" does match in nodes.shp and attributes.csv. –  coelacanth Oct 5 '12 at 20:31
add comment

2 Answers

up vote 6 down vote accepted

the attributes of a shapefile are stored in an extra dbase-file. for example: mypolygons.shp contains geometries, mypolygons.dbf contains attributes. via an id the attributes are connected to the polygons. so just simple load your dbf file into capable software (e.g libreoffice) , edit attributes and your done

share|improve this answer
Excellent, I opened and edited it successfully in MS Access. Thanks! –  coelacanth Oct 5 '12 at 20:30
But be sure not to change the order of rows. Don't sort data and don't add/delete rows. You may find that Access interferes with the formatting of data, you may have more repeatable results with libreoffice. –  Willy Oct 6 '12 at 11:35
add comment

I do this using R. There is a package called foreign which enables reading and writing of dbf files.

library(foreign) # load the package

data <- read.dbf('myfile.dbf') # read the dbf as a dataframe

In this case I just wanted to change the rounding of a column pop_den:

data$pop_den <- round(data$pop_den) # trim data (removing significant figures)

write.dbf(data, 'myfile.dbf')      # write data. This OVERWRITES your existing dbf

The caveats about re-ordering and adding/deleting rows also apply. It's hard to do these by accident in R, but you should still be careful.

share|improve this answer
add comment

Your Answer


