I am hoping someone can share a way that I can some what automatically (none manual) associate a pre-defined CSV file for use with multiple shapefiles as an attribute Value Map.

I have a number (in the hundreds) of shapefiles that have the same attributes (Type1 and Type2). Both Type1 and Type2 are numeric codes and I will like to apply text descriptions to them. I have generated a CSV file that has the value and description. What I am wondering is, is there a way to apply this CSV to all my shapefiles automatically, or will I have to open each file and associate the CSV file through the Properties dialog.

If there is an alternative method that would provide the same results I would be willing to give it a try.


  • So you want to automate the setting of Value Map?
    – Nathan W
    Commented Aug 12, 2013 at 22:56
  • Yes, to a degree. For example, I have a layer called urban_poly, and I need to tile it up into 100 pieces. I want to have all those 100 tiles have the same Value Map association (from the CSV). But I don't want to have to open each file to do the association. Commented Aug 12, 2013 at 23:00

1 Answer 1


One option is to use a Python script. I just wrote one for a different goal (generate several maps, based on the same shape file and CSV file, but with different fields). The same trick might be used for your problem. My script uses a modified project file to generate a series of project files, based on a list of field names. You could try this method by varying the name of the shape file instead.

My script can be found here: http://www.qgis.nl/media/2013/08/PythonSnapshots.zip and is described in this article: http://www.qgis.nl/2013/08/13/python-script-to-generate-series-of-maps/?lang=en.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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