Tuesday, 24 March 2015

Mapping Knoydart

I've been working on a little side-project recently that has arisen from a combination of my work, my origins and my personal interests. Part of my work involves spatial data and mapping in a GIS environment, I'm originally from the Highlands of Scotland and I like to go on holiday to the west Highlands and the islands of Scotland. I also like bad weather. Add to this open source tools (QGIS) and open data (OS VectorMap District) and a remote, rugged peninsula (Knoydart) and you get the following map, which is definitely a work in progress. This blog post explains a little bit more about the development of the map and the different data sources, methods and ideas behind it.

This is the first proper version, but still a rough draft.

The above map is the result of a good few hours work playing around with putting data together in QGIS (and a bit in ArcGIS) - OS tiles NG and NM in case you're asking - merging, dissolving and clipping and whatever else I needed to do to get rid of strange artifacts and multipoint features. I also created a hillshade layer based on the sun position at 12noon on the 12th of April. This means that the mountains of Knoydart are illuminated from the south and that you can really get a sense of what the terrain is like.

A previous version - with greener land

I'm still trying to decide on the look and feel of the final map but here's a few of the things I've done so far...
  • I've used inverted shapeburst fills in QGIS to create the blue blur effect around the shoreline. This was a little complicated because I had to merge the foreshore and land layer from the OS data - otherwise some of the blur gets lost behind the foreshore polygon layer.
  • I've used Open Sans Condensed text for the labels (with some buffering in white) and different colours for different features. I've used a red font for the spot height layer only.
  • The other font I've used is Abel - for the title, description and scale bar.
  • For other features I started off symbolising using the Ordnance Survey QGIS stylesheets and then modified them to suit my own tastes - they are really useful. 
  • I created larger curved labels for certain features (e.g. 'Sound of Sleat') by following the excellent video tutorial of Klas Karlsson.
  • I've exported it at 600dpi and used an A3 size in the Print Composer of QGIS so the resulting full resolution PNG is pretty big - about 30MB. 
  • I also added a normal shapeburst fill to the freshwater lochs - as in the image below.
The buffering on the Loch label needs work

Overall, I'm getting closer to something I'm happy with. I like the green colour better in some ways but this gives a slightly misleading impression of Knoydart so I will probably work towards something more like the actual terrain. If you've no idea where this place is, take a look at this article and video, or this trailrunning video.

That's all for now. A somewhat niche interest perhaps but makes a change from me mapping cities, deprivation and commuting and migration flows!


You can find a much higher resolution version of the first image here.


Sunday, 1 February 2015

Historic Buildings of Scotland

There are thousands of historic buildings in Scotland, from Edinburgh Castle and Eilean Donan Castle, to Glasgow Cathedral and King's College Chapel in Aberdeen. There is also an open dataset with information on all of Scotland's listed buildings, published by Historic Scotland. In fact, there is even a web map - pastmap.org.uk - which shows all sorts of historic structures and sites. But I wanted to make a web map showing only Scotland's most historic buildings (Category A Listed Buildings). These account for about 8% of Scotland's 48,000 or so Listed Buildings. A screenshot of the new interactive map is shown below.

Go to the full size web map

This is really just a little experiment in my spare time - partly done out of curiosity and partly because I use these tools when I am teaching GIS at the University of Sheffield. And also because I'm Scottish and like old buildings. I made the map in CartoDB and I used some of the annotation and web link tools to make it a little more useful. I added a little bit of information, some links to Scottish cities on the right of the map interface and also a few labels of particular points of interest. If you click on a point on the map you'll see more information on that building, including a web link to the Historic Scotland information page for it and the date it was listed, as shown below.



The map works pretty well and will look good in most web browsers but if the screen is not very big or viewed at a high resolution you may find that labels overlap a bit. Because of this I also created a clean version of the map with only minimal labels. Also, if you want the map centred and zoomed to a specific location of your own choosing, this can be done quite easily, as follows...

  1. Go to one of the city links I put on the main map - for example, Edinburgh.
  2. Look at the web address (as in the image below) and you'll see latitude and longitude coordinates plus a zoom value. These can be customised and then the new link shared as you wish.
  3. To get any lat/long values for anywhere, the simplest way is to go to Google maps, search for a location and then copy the lat/long values from the url.
  4. You can of course also do this from the clean version of the map.
  5. Share and embed as you wish, via the little icon to the top right of the map.



That's about all there is to say about it. Hope you find it informative and useful. Let me know if you spot any glaring errors.


Sunday, 2 November 2014

The Urban Footprint of Scottish Cities

I recently did some mapping on my other blog which showed the urban footprint of English cities, which seemed to strike a chord with lots of people. I had already extracted the data for Scottish cities and made it publicly available, so I thought I'd do something similar here. The images below show what you might call the urban footprint of seven Scottish cities - Glasgow, Edinburgh, Aberdeen, Dundee, Inverness, Stirling and Perth. These are settlements with official 'city' status though some places have more people than the smaller Scottish cities. The first image shows the seven Scottish cities mapped at the same scale. Glasgow, Edinburgh, Aberdeen and Dundee are all local council areas in their own right so I've shown the urban footprint of those areas within their administrative boundary. The other three smaller Scottish cities sit within much larger local authority areas so I've tried to show the core urban areas of these places (i.e. the continuous urban fabric of the city).

Click here for larger version

Same as above, but with scale bar - big version

In order demonstrate how Glasgow's council boundary 'under-bounds' the urban area, I've also extracted an image showing the wider Greater Glasgow urban area (and a bit beyond) with the boundaries of all council areas overlaid on top. This does of course raise the question of what a 'city' is, but that's a debate for another time. The purpose of this little mapping experiment was just to provide a visual comparison of the size of the seven Scottish cities in relation to their built up areas.

Greater Glasgow urban area - bigger version

If you want these images in higher resolution versions, I've uploaded them in this zipped folder - the first image in full size and half size, in addition to the Glasgow image at full resolution. I know there is a lot more to Scotland's urban places than the seven 'official' cities, but I've just focused on them for now in these simple graphics. Maybe I'll come back to this in future.

Addendum: after the original post I added in a revised first map with a scale bar, just to provide a little more context for those unfamiliar with the places I've mapped. To provide a bit more information, the populations of the cities are as follows: Glasgow - 599,000; Edinburgh - 495,000; Aberdeen - 212,000; Dundee - 142,000; Stirling - 46,000; Perth - 47,000; Inverness - 57,000. For the final three cities, these populations equate to the urban areas I've shown but are not precise. I've written about this issue before, in a blog post from a few years ago. The Greater Glasgow area - comprising the contiguous built-up area - has a population of about 1.2 million and the wider Glasgow City Region has a population of about 1.7 million. 


Thursday, 18 September 2014

Indyref 2014: results map and downloadable data

This page is the result of a little overnight mapping while I watched the Scottish Independence Referendum on 18/19 September 2014. You can explore the results in the map below or download the raw data at the bottom of the page.

I'll add to the map as results come out, but if you click on Glasgow or Edinburgh you'll see that I've loaded in some pretend data for now. You'll also see that in the clickable info windows you can scroll down and download the underlying data table and geographic shapefile (I'll make this link live once all results are in). Most areas are red now as they have no data...


Independence Referendum Results Map (full screen version)



You can access the raw data from the infowindow when you click on the map or by using the links below. Feel free to use this for mapping and exploring the results.

Data table - this is a basic excel table with the the results, including % yes, % no, turnout, area codes and so on.

Shapefile (for GIS users) - this should work fine. You just need to unzip it and add it to the GIS of your choice.

KML- you can download the KML file from either of the map tabs (the ones with the little red map pin icons) at this link.


Small disclaimer: I put these together overnight as the results were coming in. I have checked them for errors but if you spot any problems let me know and I'll fix them.


Monday, 15 September 2014

Indyref 2014: the electorate, area-by-area map

I've blogged previously here about the 32 council areas of Scotland and their populations but this post is specifically about the total electorate for the Scottish Independence Referendum held on Thursday 18 September 2014. I've put this online as a reminder to myself (and others) of the number of people registered to vote nationally and in each area because the results will come in on a council-by-council basis through the early hours of 19 September. In total, there are 4,285,323 registered voters across Scotland (97% of those eligible). But where are they all? See the map below for details of this by clicking on an area - or click the link below the map to view a drop-down list of areas.



So, if you don't know your Clackmannanshire from your Angus, or your East Ayrshire from your East Dunbartonshire, this little map should help. Many people I know here in England are less than familiar with the exact location or attributes of Scottish local authorities - as are many people in Scotland - so this is really just a visual guide. The results are expected to emerge between 2am and 6am, so we'll be able to do our sums through the night! You can view the underlying data table here.

Another very interesting dimension to the referendum - apart from the outcome, the 'don't knows', the level of engagement and all sorts of other things - is the fact that 16 and 17 year olds are eligible to vote. The total numbers are not very high - 109,533 - but given the closeness of the polling this group in particular could have a decisive role to play. Highland Council have provided a breakdown of the figures across Scotland, ranging from a high of 10,864 in Glasgow to 460 in Orkney. But, how likely are people in each area to vote either Yes or No? Chris Hanretty from the University of East Anglia has a short blog post on this, which is worth reading - plus a nice graphic.

In total, 18% of registered voters were those intending to vote by post. This figure is pretty high and many people (my parents included) voted in this way before the Westminster machine came to life following the YouGov poll lead from last week.

Finally, one of the best things about the referendum is the fact that turnout is expected to be extremely high - perhaps in the region of 90%. When the results start coming in we'll have an idea of what kind of turnout we can expect and what the magic number is in terms of either Yes or No securing a majority. I've calculated this for turnout ranging from a high estimate of 95% to a low of 70%, as below. The second column shows how many votes would be cast under each level of turnout and the final column shows the '50% +1' figure that would secure a majority for either side.



Buckle up, etc.


Friday, 5 September 2014

Buildings of Scotland in one layer

This is a short post to provide an update on a little mapping project that's been on the back burner for a while. With the release of Ordnance Survey open data products a couple of years ago, people have been using the buildings layer in the Vector Map District product to clip larger geographic areas and show only those areas where people live - or, more accurately, where there are buildings - as below.

This is what the layer looks like

The data come in Ordnance Survey tiles and as anyone who has worked with this knows, it's inevitable that the area you want to map will fall at the intersection of four tiles. Well, it sometimes seems this way. To solve this problem, I've patched together the buildings layer for all tiles and made it available for download in the Data section of the site. I've done this because I wanted to have a ready-made layer for using in my work and I'm sharing it because I know others might find it useful. The file, when unzipped, is about 134MB so it's not too big. Anyone using this just needs to know that it's a fairly generalised file and not individual building outlines. You'll see that when you zoom in the buildings have been merged together in many places (as below). That's all for now.

The centre of the universe

Tuesday, 26 August 2014

Travel to Work Patterns in Scotland

I've recently been working with local level travel to work data for England and Wales from the 2011 Census and have produced a few maps of this. The same level of data are not yet available for Scotland but looking back through my data archives I discovered (to my horror) that I had not mapped Scottish commuting patterns for 2001 in any kind of detail. So, I plugged in QGIS, got the Data Zone travel to work data in the right format and produced a few maps. All this is of course in preparation for when the 2011 data becomes available and I can then compare how commuting patterns have changed. For now, though, I just wanted to share these maps, which I think do a good job of identifying the spatial structure of commuting as it was in 2001. I don't know if it will have changed much but it will be interesting to find out in due course. Click any of the maps to enlarge.

A general overview - bigger map

A smaller zoomed-in version showing Central Scotland

Selected cities - bigger map

Travel to work data for Scotland also includes travel to place of school or study so I just stripped those bits out and mapped travel to work flows. The other technical detail is that in 2001 many of the smaller flows were subject to a disclosure control process where flows with a value of 0, 1, 2 and 3 were changed in order to preserve confidentiality. But I'm not really worried about that for now as these maps are just intended to convey the broad patterns and I think they do that quite well.