1

I've looked through some QGIS tutorials, but I haven't found anything yet that describes what I'm trying to do.

I have a CSV with a column for country names and other columns for attribute variables about the countries. The variables are categories. Let's say one column is diabetes rate. The levels of the category in this case might be:

1 = 0 to 0.24
2 = 0.25 to 0.49
3 = 0.50 to 0.74
4 = 0.75 to 1.00

I want to make a world map with each country color-coded to one of the 4 levels. I think that's called a choropleth map.

I think I need to start out with a shapefile that has the world geometry in it. I looked at some examples, and it appears I can use those as starter kits.

My data file with the country attributes has no coordinates, just country names. When I try adding that CSV to my QGIS project, QGIS wants me to indicate the columns in my file that contain the X and Y coordinates. The file isn't structured like that. It just has the name of the country.

I trust there is a way to map the country names I have to the location structure in whatever shapefile I'm using.

Is that the workflow?

I know what I need to do is just learn how to use this program. I'm hoping someone can tell me how correctly to describe the task I'm attempting so I can find an appropriate tutorial that focuses on this explicit mapping objective.

2
  • 1
    The right spelling is Choropleth map not Chloropleth; more info on this map type : en.wikipedia.org/wiki/Choropleth_map
    – J.R
    Commented Nov 30, 2021 at 12:04
  • I can't believe I've been making such a basic mistake for so long. Thank you! Commented Dec 1, 2021 at 18:56

1 Answer 1

5

After obtaining a dataset containing the boundarys of all countries (naturalearthdata.com is a good point to start, alternatively get the boundarys from Openstreetmap via the QuickOSM Plugin) you need to join your CSV to your country-data. In QGIS, right click on your dataset (countries) -> properties -> Joins. Here you can select the layer which contains the data you want to have joined to your country-data. They should have one column in common (country-names). Based on this column all data is added to your country layer.

Note: Joins are temporarily. To have the data permanently, you need to export your layer to a new file!

Right click your exported layer -> properties -> symbology. Select "Categorized", classify your column containing the diabetes data, adjust the colors etc to your liking and your map should look like desired!

1
  • Join may sometime not work or only partially work if the field used for the join have not exactly the same value. For country name capitalisation, hyphen, accented character, regional/local spelling, ... , may differ between your CSV and shapefile and cause problem so you may have to add an intermediate steep of "normalizing" one or both field before joining
    – J.R
    Commented Nov 30, 2021 at 12:12

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.