Mapped: charities in the West Midlands using QGIS/Leaflet

Thanks to a suggestion from Pauline at RnR Organisation, I decided to have a go at mapping all registered charities in the West Midlands. 

The map shows all 13,653 charities that were registered with the Charity Commission in September 2016, and had registered with a postcode that falls within the West Midlands. The layers tab on the right allows for filtering by category of activity (proportional by income), the search function on the left searches by charity name. The layers are ordered by frequency of type (with 82 umbrella bodies and 2383 religious orgs).

It was pretty straight forward to make (and required no coding), so I thought I’d share how it was done, and what I’d like to improve on.

The Data

The data is drawn from the Charity Commission’s register. NCVO/David Kane have done a great job of explaining how to access it (some Python use required). I used a dataset that had been cleaned and classified (thanks to TSRC/NCVO) so I just needed to geocode the postcodes. (David Kane has made a great tool for helping with this if you’re a GIS novice). I split the charities into the 20 areas of activity and saved as .csv

QGIS

QGIS is free to download and there are loads of tutorials available. It’s far and away my preferred GIS desktop programme. After uploading the 20 layers, I colour coded and stylised the symbols (proportion, transparency/blending etc). Color brewer gives a max of 12 distinct HEX classes, so I used this blog to give me a large palette.

QGIS to Leaflet

Leaflet is a commonly used open-source JavaScript library which gives you the tools for a great web map. But here’s where the real magic happens…there’s a QGIS plugin that outputs your QGIS project as a leaflet-based map, with all the source code neatly packaged up and a simple .html file which shows the actual map. The search function (on the left) will only search one layer at a time, so I made an invisible layer that has all the charities that are mapped, allowing all layers to be searched.

Uploading to web

If you have your own server, just upload the files and pull the map through using an iframe, or add a new page. I’ve made use of Amazon Web Services to host the map instead (AWS S3 -> new bucket – > make public).

Challenges

I’m pleased with the outcome, but there are some changes I would make next time and some issues to be aware of:

  • Visualising 13,653 organisations was a challenge and I spent a while trying to get the balance between seeing smaller organisations and conveying differences in income. It’s not perfect, so let me know if you have any suggestions. I find the map works best when all layers are turned off, and then turned on one at a time.
  • Selecting charities can be hard when locations overlap or charities are subsidiaries / use the same postcode. A good example of this is Islamic Relief, who have both Islamic Relief Worldwide (income >£100m) and Islamic Relief UK (no registered income) on the same postcode. If I had the time I’m sure I could disperse the markers somehow. I’d also like to introduce a search by keyword, postcode, etc.
  • Blank / unknown categories are frustrating, but reflects the unstandardised nature of Charity Commission registrations and the consequential fuzzy data. For example, ‘Unknown activity (n=886) ‘ is the 4th biggest classification on the map, and 805 organisations have blank income fields. I was surprised to see a PTA with income of over £1m, but it turned out to be the Swimming Teachers’ Association. Again showing the difficulties of data classification!
  • Showing no. of orgs per activity classification and income is important, but I couldn’t get this to transfer from QGIS to leaflet. Any suggestions on where/if this could be added in the code would be appreciated!
  • Search zoom is not quite working properly, in that it doesn’t scale the map to show the search result as visible, unless the map is already on a low scale. Again, any tips for rectifying this would be appreciated!

 

2 thoughts on “Mapped: charities in the West Midlands using QGIS/Leaflet”

Leave a comment