Thursday 21 May 2015

Hexagonal Tile Map of New Zealand Electorates

Tile grid maps are a great way to represent thematic data for regions of equal importance. Tile grid maps use a simple regular tessellation (triangles, rectangles, or hexagons) to represent geographic regions. The tiles are positioned to create recognisable shapes that approximately conserve the correct relative positions of the features.

During the 2015 election in Britain hexagonal tile choropleths were the map de jour. As typified by this example from Bloomberg. Danny DeBelius gives some examples from the USA  here. Chris McDowall experiments with New Zealand electorates here

Given that I am a hexagon fan and love a good spatial meme,  here is my hexagonal tile choropleth map of New Zealand electorates.

Why regular tiles?

Choropleth maps generally consist of accurately represented geographic features that are coloured or textured to represent a theme that varies spatially. Quantitative totals can be represented in choropleth maps by normalising the value by area. However, strict adherence to geographic accuracy can make maps misleading when the regions of interest are very different sizes but of similar importance. In addition, it is very difficult to normalise nominal data.

Tile grids, however, offer simple geometries of equal area whilst still imparting a sense of the spatial variation of the theme being mapped.

Electorate maps are a good example. The electorates of New Zealand contain similar voting populations and are each represented by a single 'electorate' seat in the New Zealand parliament. However, the large rural seats dominate a geographically accurate choropleth map.

Cartograms mitigate this bias by distorted and resizing shapes to reflect some statistical measure whilst retaining topological accuracy. Cartograms are typically combined with colour to represent multiple variables. They can also be used to equalise the areas of the regions in a choropleth, effectively normalising nominal data. However, this can create maps that, although interesting, are quite confusing and very complicated. This is where the uniformity of grid tile maps come in.

How the map was made

The arrangement of electorates into tiles was a manual and subjective process. I am sure analytical methods are possible but I suspect it would be difficult to retain the legibility of the map without  human input in the design.

The dominance of Auckland in the population distribution of New Zealand created some problems. Two issues I found were that Hamilton and Taupo were pushed further south than I would like and Bay of Plenty is inland. In the South Island, Christchurch extends all the way to the West Coast. Maybe you could do better? I would love to see alternative layouts.

The cells of the hexagonal grid were sized such that the total area covered by the 64 electorate hexagons was similar to New Zealand's actual area. The size of the tiles is not important but consistency did allow easy comparison between the tile grid and true geography.

My first version of the tile map was generated from the centroids of the equalised cartogram shown above. Where more than one centroids were in a single hexagonal tile, I moved one to the nearest available tile. Then I joined the centroids to the hexagonal tiles using a spatial join, keeping only the joined features. I continued to experiment with different layouts until I was happy with the result. Finally I made a separate map for the Maori seats. Square and triangular versions are in development.

But how would one represent the all important party vote? That question will be addressed in a future post.


Shapefiles of my hexagonal tile map of NZ electorates can be downloaded here. I have also included a blank tessellation of hexagons, approximately centred in Wellington if you would like to make your own arrangement. All data sets are in NZTM2000.

Creative Commons License
This work by @MAPdruid is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Thursday 23 April 2015

Relief Map Techniques

Click for full size (large)
Work in progress

Monday 30 March 2015

Countries near New Zealand

New Zealand has many advantages: proximity to India and China are not amongst them

People sometimes claim that New Zealand is close to China and India. For instance here.

Viewing the Earth through the lens of the Mercator projection, the way google maps does, this misconception is almost forgiveable. New Zealand is over there on the same side of the map as Asia, just further down. However, the Mercator projection is a distorted view of the world that grossly exaggerates distances toward the poles.

What area would you define as close on a global scale? I suggest that a generous definition of close is that two countries are close if they are on the same quarter of the Earth's surface, and that a country not even on the same half of the world would be very far away indeed. So are China and India close to New Zealand by this definition?

Imagine a circle drawn on the surface of the Earth. Its radius is represented on the Earth's surface by a geodesic: a line of constant direction that curves as it travels around the earth. A geodesic that stretches 1/4 of the way around the circumference of the Earth will, if rotated through 360 degrees, draw out a spherical cap that covers half the world. The perimeter of this cap will be a circle on a globe but its shape will be distorted on a projected map.

A geodesic that stretches 1/6th of the way around the world will, when rotated, draw a cap that covers 1/4 of the Earth's surface. The countries that are inside such a spherical cap, with Wellington as its centre, are labelled on the map below. Clearly China and India are not among them.

Click image for bigger version

Creative Commons License
This work by @MAPdruid is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Monday 2 February 2015

Distribution of sheep farming and diary farming in NZ

From sheep farming to dairy farming

New Zealand is world famous for its sheep. However, in recent decades many New Zealand farmers have been converting from sheep to dairy farming. These conversions have been motivated in part by high export prices for dried milk powder and other dairy products. New Zealand sheep numbers peaked in 1982 at 70.3 million and have since declined to 29.6 million.

In 1941 Oliver Duff wrote that the choice of sheep or dairy farming was a  battle of civilisations. From the New Zealand Electronic Text Collection:
"For the history of New Zealand is not so much a struggle between different races of men as between two great families of domestic animals. It is the battle of the sheep and the cows ... if it is not quite the battle of two civilisations, [it] is the battle of two social systems. Sheep make gentlemen and cows unmake them. Sheep leave you with clean hands and clean feet, but cows drag your pride into the mud. Sheep leave you free, cows enslave you. Sheep make you a big farmer, cows make you a small farmer." 
The gentrifying influence of sheep farming seems to be less strong in the 21st Century.

I was interested to see dot density maps of sheep and dairy cows in New Zealand in 1941, which show clearly the dominance of dairy in the west and sheep in the east. Below is an updated map showing the livestock numbers of sheep, beef and dairy cows in 1994 and 2013.

Click image for bigger version
The proliferation of dairy cows in Waikato, Canterbury and Southland is clearly visible as is the nationwide decline in sheep numbers.

How the map was made

Data Sources

Department of Conservation, Public Conservation AreasCC by 3.0 NZ.
LINZ, NZ Exotic ForestsCC by 3.0 NZ
LINZ, NZ Native ForestsCC by 3.0 NZ
LINZ, NZ Lakes, Creative CC by 3.0 NZ
Statistics New Zealand, Regional Authorities 2013 Clipped.
Lucas New Zealand, Land Use Map 1990-2008CC by 3.0 NZ.
Statistics New Zealand, Live Stock Numbers by Regional Council.

Sheep Photograph, Sarah MacMillan, EssjayNZCC BY-NC-SA 2.0
Cow Photograph, Mulla Eshet, Robert Harding World Imagery, Corbis, CC BY-NC-SA 2.0.


Mapping: ArcGIS Desktop 10.2
Masking: Gimp 2.8.6
Final layout and text: Inkscape 0.48


The map is an dasymetric dot density map. White, brown and black points are randomly distributed across the Regional Authority polygons such that their density is proportional to the density of sheep, beef and dairy livestock numbers respectively.

The dot density map is dasymetric because the dots are confined to areas that are classified as pasture in the Land Use Map and excluded from areas classified as National Park, Wilderness Area, Nature Reserve or Conservation park in the Public Conservation Areas.

Dot density maps work best with only one band. If there are multiple bands the drawing order tends to create a visual bias toward the band that is drawn on top. Using transparency creates a washed-out look so, instead, I minimised the bias using an additional  field. I randomly assigned values from 1-3 to the additional field, symbolised the points by Unique Values Many Fields (type field and random field), and used the random value as the drawing order.

A cartographic purist would argue that dot density maps should be created using an equal area projection but the areal distortion of mainland NZ under NZTM is not significant. so I decided to use the familiar projection.

In order to have background images, the very annoying .png transparency bug in ArcGIS forced me to export the map with a blue background and convert this to transparent in external software. I have heard a rumour that this bug is finally fixed in 10.3: I hope so.