Simple Choropleth Maps in Quantum GIS

It’s straightforward to create attractive choropleth maps in Quantum GIS, but there are a few things that can trip you up in the process.

The choropleth map I want to show is the distribution of deliberate fire-starting across London. A more advanced analysis would weight by ward area or population size, but I’m just showing the raw results, on the probably flawed assumption that wards in London have approximately equal populations and don’t vary in size hugely. Here’s how to do it, in Quantum GIS 1.4 “Enceladus” which was released a few days ago.

1. My boundary spatial data is a shapefile of the wards of London, which Quantum GIS can load without a problem, but my statistical data is in the form of a CSV file, showing the numbers of deliberate fires in each ward. It’s supplied by the new London Datastore, and CSV should not be a problem, but unfortunately the “Join attributes” functionality in Quantum GIS needs the data in DBF format.

Annoyingly, the most recent versions of Microsoft Office applications do not allow you to save data files as DBFs. However, OpenOffice will allow the conversion.

The big gotcha is that Quantum GIS is quite happy to load the CSV file as a layer, and will not complain if you select it as a vector layer to join in the “Join attributes” dialog box. It will simply go ahead and produce a result shapefile containing no data. This was the monitor-throwing bit. You have to instead select “Join dbf table”, and as the caption suggests, it needs to be a DBF.

There is also a bug in the “Join attributes” dialog box – available table columns are not removed when you select different layers in the drop downs, they just get appended to the list, so be careful to select the correct one.

I’ve used the “Continuous Color” option for the symbology setting as this allows me to quickly change the colours and remove the outlines – using “Graduated Symbol” would be a more authentic choropleth as the map would show discrete colours for each grouping.

Here is the resulting choropleth map, with the default adornments. Looks rather nice!

3 replies on “Simple Choropleth Maps in Quantum GIS”

Olá Oliver,

Muito boa a info sobre mapas coropleticos no QGIS.
Ainda não conhecia seu blog, achei muito bem estruturado e de fácil acesso… Vou indica-lo aos amigos.

Um abraço

Good point about the legend – I was being a bit lazy. It’s a screenshot of the application’s data view, rather than a composed map (aka layout view). So the legend is in the TOC panel on the left, but I’ve cropped that out. The scale and north arrow are in the data view by default.

The “Print Composer” in QGIS has a button to add an automatic legend anywhere on the map. However, as I’m using a graduated symbol, it wouldn’t be particularly useful – it would just show the bottom and top colours.

QGIS’s cartography is starting to get rather good – I think presentation and visualisation is its strength. Analysis is more difficult, it is getting better (with fTools, and GRASS interoperability) but still has some way to go.

Where’s the legend and all the other cartographic/design bumpf? I’ve played with QGIS before and found that these are the elements that are most lacking in terms of output at the moment.

Leave a Reply

Your email address will not be published. Required fields are marked *