Using QGIS 2.18, imagery from NASA and hypsometric tint map from Natural Earth.
This map shows which country is due east/west of you, when you stand somewhere on the coastline of the UK.
Grey points mean the land to the east/west is in the UK.
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
- 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 (
a as (select * from point5grid)
sum(a.sum) OVER (
PARTITION BY 1
ORDER BY st_x(st_centroid(a.geom)) asc,
) as cumpop
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 (
a as (select * from point5grid where sum is not null),
b as (select * from point5grid where gid = 148748)
) as dist,
sum(a.sum) OVER (
PARTITION BY 1
ORDER BY st_distance_sphere(
) as cumpop
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!
How it was done
To get the globe, I had to use a custom CRS for on-the-fly projection, an Ortho projection centered on (90W,44N). I created a custom CRS with the following proj4 settings:-
+proj=ortho +lat_0=44.0 +lon_0=-90.0 +x_0=0 +y_0=0
If you try to render a whole-world dataset using that projection, you get horrible artifacts. In some projections, this is caused by features crossing the anti-meridian. In the case of ortho, it's caused by features crossing the edge of the visible hemisphere.
To get around this, I used the Clip to Hemisphere plugin. This plugin lets you set a vector layer, a latitude and longitude, and clips the vector layer to the visible hemisphere.
I ran this against several layers, namely
- the hurricane lines layer
- the 15 degree graticule layer from Natural Earth
- the 10m country polygons from Natural Earth
- the WGS84 bounding box layer from Natural Earth
the end result is shown below (in WGS84). I used a Draw effect (Outer Glow) on the clipped WGS84 bounding box to give the 'atmosphere glow' effect.
and this is what it looks like using the custom CRS:-
Preparing for Time Manager
The Time Manager plugin allows you to export multiple renderings, based on a time value. If you have a time-based field on each feature, it will render only those features within a specific time interval.
The original dataset contained a field called season, giving the year (1845, 1846, ... 2015). I added a field called season2, which was season minus 1845. So each hurricane trail was given a value according to year, starting at 0.
I then told Time Manager to use this field. If time manager sees the field is a number, it assumes it's a unix time stamp (seconds since midnight on 1st Jan 1970). By setting the frame interval to 1 second, each successive frame showed one year's worth of hurricanes.
Rendering the Video using ffmpeg
I tend to use ffmpeg for video stitching, as it allows good control of frame rates, resolution and quality. The tip I have is to get rid of all the .pngw world files that Time Manager generates, as they get picked up by ffmpeg and make it fall over.
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 ;-)
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.
Pictish place names
One of the few Pictish place names I could find was -carden- (or -cardine). For example, Kincardine.
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)
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).
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.