1

I am trying to produce a map with QGIS that has counties shaded according to the percentage of people born in a US Region. For example, counties with a high percentage of people born in the South region would be shaded darker than counties with a small percentage of people born in the South region.

I have so far been unsuccessful. I first looked for a way to "normalize" the number of people born in the South to the total population, but QGIS does not have that function. I then tried using the field calculator to calculate the percentage, but was unable since the CSV file I imported with my data cannot be edited in QGIS. I then calculated the percentages in Excel, saved it in a CSV file, and then tried to plot it, but I could not do it because it was a string rather than an integer. I then went back and had Excel multiply the numbers by 100 and then had it round to the nearest integer, only to find that QGIS still said that the fields in question were strings, not integers.

What can I do to get QGIS to produce the color ramp I want if I cannot get my percentages to turn into integers? Or is there another way to get what I want that I have neglected? Please bear in mind that I am fairly new to GIS.

2
  • 3
    If you want to map, why not join your csv with a shapefile (which makes it editable). Then you could use the fieldeditor to generate a percentage field
    – Curlew
    Commented Oct 11, 2013 at 19:42
  • Please check out gis.stackexchange.com/questions/29606/… I hope it will help Commented Oct 11, 2013 at 21:46

1 Answer 1

1

I would suggest you to use field calculator to add new column using following expression

= toInt(column_name)

Where toInt is function and column_name is your string column which contains percentages for counties.

Or

put a file in the same folder with the ending csvt. For example your file name is mycsv.csv you add the file mycsv.csvt

This one you can edit with editor for example. And in it you set the data type like this. "Integer","String","Integer","Integer","String","Real"

I hope it will help.

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.