In this post, we shall learn how to map the 2023 StatiSense murder cases data in Nigeria by geopolitical zone.
To map the geopolitical zones dataset, we can use several essential mapping tools to build a choropleth map including using QGIS or Python with geopandas and matplotlib.
To map this dataset in QGIS, we need to link the regional numbers to a digital map layer (Shapefile or GeoJSON) of Nigeria. Here is the exact step-by-step process to build the choropleth map.
Step 1: Download Nigeria's Geographic Data
QGIS needs a base map of Nigeria divided by states or geopolitical zones.
- Go to a public repository like GRID3 Nigeria or Humdata.
- Search for and download the Nigeria Administrative Boundary Level 1 (States) Shapefile.
- Extract the downloaded
.zipfile into a dedicated folder on your computer.
Step 2: Prepare Your Murder Dataset
Create a clean spreadsheet so QGIS can read your numbers correctly.
- Open Excel or Google Sheets.
- Create two columns named exactly:
ZoneandMurders. - Fill in the data carefully:
- North Central | 436
- North West | 417
- North East | 345
- South West | 174
- South East | 169
- Save the file as a CSV (Comma Delimited) file named
nigeria_murders.csv.
Step 3: Load Data into QGIS
- Open QGIS Desktop.
- Click Layer -> Add Layer -> Add Vector Layer.
- Browse to your extracted shapefile folder, select the file ending in
.shp, and click Add. - Click Layer -> Add Layer -> Add Delimited Text Layer.
- Select your
nigeria_murders.csvfile. - Under Geometry Definition, choose No geometry (attribute table only), then click Add.
Step 4: Group States into Geopolitical Zones
Note: If your downloaded shapefile already has a "Zone" column, you can skip to Step 5.
- Right-click your Nigeria shapefile layer in the Layers panel and select Open Attribute Table.
- Click the Toggle Editing Mode icon (the yellow pencil).
- Click Open Field Calculator.
- Set the Output field name to
Zoneand change the field type to Text (string). - In the expression box, use a
CASEstatement to group the states. For example:sqlCASE WHEN "name" IN ('Kano', 'Kaduna', 'Katsina', 'Kebbi', 'Sokoto', 'Zamfara', 'Jigawa') THEN 'North West' WHEN "name" IN ('Kwara', 'Niger', 'Kogi', 'Benue', 'Plateau', 'Nasirawa', 'FCT') THEN 'North Central' -- Repeat for other zones based on the states in your shapefile ENDCASE WHEN "name" IN ('Kano', 'Kaduna', 'Katsina', 'Kebbi', 'Sokoto', 'Zamfara', 'Jigawa') THEN 'North West' WHEN "name" IN ('Kwara', 'Niger', 'Kogi', 'Benue', 'Plateau', 'Nasirawa', 'FCT') THEN 'North Central' -- Repeat for other zones based on the states in your shapefile END
