11

I have successfully joined data from a csv file to a shapefile in QGIS but for some reason I am having trouble symbolizing my data.

I want to use a graduated symbology however this option is not available for any of the columns for my joined table.

I have tried saving as a new layer but this does not change the issue.

Has anybody got any tips to get around this?

10

The problem most likely is that all CSV columns have been imported as text fields. Text cannot be used for graduated styles.

To fix this, you need a .csvt file for your CSV which specifies the data type of CSV columns explicitly. Basically, a .csvt file is a text file with only one line, e.g.

"Integer","Real","String"

For a CSV file with three columns. More info: http://underdark.wordpress.com/2011/03/07/how-to-specify-data-types-of-csv-columns-for-use-in-qgis/

You'll be able to verify if specifying data types worked, by checking the csv layer's "Fields" tab and the data types listed there.

4

I was tried using the CSVT file too but got better results by simply saving a Libre Office spreadsheet to a DBF.

Then bring in the DBF into QGIS as a vector layer - and it will come in as a table.

The fields in the DBF in QGIS seem to auto-format quite nicely, whereas I couldn't get the CSV / CSVT file to work at all.

0

Yes, your data might be in string and not a numeric value, which graduated symbol options require. If your data-set is not very large, open .csv file in excel and select the columns and paste as values. Save it in .xls or *.xlsx format and you are good to go.

0

I had the same problem, saving the table from open office as a dbf file, then doing a little editing of column headers so they were continuous strings with no spaces or punctuation did the trick.

It was then possible to take them in via the QGIS browser window into layers and then link them to the shapefile layer I was using

0

The post has been a while ago, but seems the best way is to use QGIS with ReFactored:

https://wiki.tuflow.com/index.php?title=QGIS_Change_Attribute_Type

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.