Quarters of the Earth's Population

A cartographic / infoviz experiment, dividing the world up into quarters - 4 areas of equal population.

For this, I used the SEDAC Gridded World Population raster. This gives a 2015 estimate of the population as  7,373,246,130 (7.37 billion)

This is quite a high-resolution raster, so I decided to apply a grid of 0.5 x 0.5 degrees. This was done in QGIS 2.16 using the Make Regular Grid (Polygons), then using Zonal Statistics to get the total population in each cell.

There are four maps - from the top

  • by longitude
  • by latitude
  • by great-circle distance from Shanghai
  • by great-circle distance from London

Interesting finds

  • the Western Hemisphere is home to less than 1/4 of the world's population
  • the same goes for the southern hemisphere

How this was done

I used postgres/postgis to do the query. I used shp2pgsql to import the 0.5 degree polygon grid (with summary stats) into a table called point5grid. The sum field contains the total population for that cell (or NULL if no-one lives there - which is a lot of places)

The challenging part for me was to find a way of creating a running total (cumulative total) of the population. The trick to this was the SUM(sum) OVER PARTION BY 1. I was originally going to do this in a spreadsheet, but was delighted to find it could be done in the query. This creates a field called cumpop which holds a running total from one row to the next - the order by must match the outer order-by clause :)

For the longitude version:-

create table ordered_xy as (
with
    a as (select * from point5grid)
select
    a.gid,
    a.geom,
    a.sum,
    sum(a.sum) OVER (
        PARTITION BY 1
        ORDER BY st_x(st_centroid(a.geom)) asc,
                          st_y(st_centroid(a.geom)) desc
    ) as cumpop
from
    a
order by
    st_x(st_centroid(a.geom)) asc,
    st_y(st_centroid(a.geom)) desc
);

The great distance versions are a bit more complex, but works on a similar principle.

The magic number 148748 is the gid of the cell I want to start in.. this is found in QGIS with the identify tool.

create table centered_uk_geoid as (
with
    a as (select * from point5grid where sum is not null),
    b as (select * from point5grid where gid = 148748)
select
    a.gid,
    a.geom,
    a.sum,
    st_distance_sphere(
        st_centroid(a.geom),
        st_centroid(b.geom)
    ) as dist,
    sum(a.sum) OVER (
        PARTITION BY 1
        ORDER BY st_distance_sphere(
            st_centroid(a.geom),
            st_centroid(b.geom)
        ) asc
    ) as cumpop
from
    a,b
order by
    st_distance(
        st_centroid(a.geom),
        st_centroid(b.geom)
    ) asc
);

Finally, this table is imported into QGIS, and styled using Rule-based rendering. Four bands are used, and colourised with the rule cumpop<X and cumpop is not null.  X is then set to multiples of 1/4 of the Earth's population for each successive band.

Being able to copy and paste styles between layers is a great help here!

 

Toponymy - mapping place name patterns in Great Britain with QGIS

This project was to study the distribution of certain patterns in place names of Great Britain. To do this, I used the Ordnance Survey Open Gazetteer (crown copyright and database rights). These maps were created in QGIS.

Place names in Britain come from a number of sources; Old English, Brythonic (Old British), Old Norse (via the Vikings), Pictish and Gaelic. Wikipedia has a write up here; I used this as inspiration for the queries.

The maps use a hexagonal grid of approx 20x20km. The colour represents the number of places with that pattern within the cell.

Danelaw and the Viking Influence

This map shows the distribution of places ending in -by, -thorpe, -thwaite, -toft, -kirk, -ness. In England, it shows the diagonal band from Cumbria to Lincolnshire which was under DaneLaw. In Scotland, it shows most influence in Orkney and Shetland. Most of the remaining ones in Scotland are 'kirk'. I did a map like this a few years back, but the cartography was pretty basic ;-)

places with Viking imports

Legend

These maps all use the following legend. I originally used Jenks Breaks to categorise the regions; they almost always came out with a distribution of 1-2, 2-4, 4-8 etc. So that's what I used.

legend.png


Pictish place names

One of the few Pictish place names I could find was -carden- (or -cardine). For example, Kincardine.

-carden or -cardine. The ones on the Welsh border are probably not of pictish origin!

Places beginning with Llan-

If there's an obvious Welsh place name pattern, it's the prefix Llan- (meaning Church). This is borne out by the map, which shows almost all such places in Wales (or near the English/Welsh border)

places beggining with Llan-

Influence of Brythonic - combe, coombe, cwm

Brythonic is one of the old British languages. Its word for valley is spelt differently; -coome or -coombe in England, cwm in Welsh. The sphere of influcence is felt most strongly in Wales, Devon and Somerset. Brythonic names are certainly found as far north as Edinburgh (for example, Penicuik is derived from Pen Y Cog, a name which wouldn't look out of place in Wales).

-combe, -coombe, -cwm, Brythonic

-combe, -coombe, -cwm, Brythonic

Making of the Map

In QGIS, I used MMQGIS to make the hexagonal grid. I removed cells which didn't overlap land, and manually removed some more hexes for aesthetic reasons (e.g. to separate the Western Isles from the mainland).

Each map was done by querying the gazetteer, saving as a new points layer, and doing a points-in-polygon analysis of this layer with the hex grid.

Finally, I buffer/dissolved the hex cells into a new layer to get the outline. The dashed outline was from applying Multi Ring Buffer plugin to this layer.