Showing posts with label flow lines. Show all posts
Showing posts with label flow lines. Show all posts

Sunday, 18 October 2015

Glowing lines in QGIS

In one of my previous QGIS posts, on flow mapping, I outlined a method for mapping origin-destination data related to movements, rendered as a collection of straight lines from point a to b. One thing I didn't do in that post was explain how you get the 'glow' effect to make the lines appear brighter at higher densities (example below).

A little glowing flow map example from my US commuting map

Since a few people have asked about it, I thought I'd share it - and thanks to Nyall Dawson and all the other QGIS developers for making this possible. If I begin with a commuting flow dataset I made for England and Wales and just add it to QGIS, here's what I get (click on the individual images to see them full size):

We can see the country outline, that's about it

Next, let's try reducing the default line width from 0.26 to 0.1 and see what happens...

This is a bit clearer, but still not very useful.

We could darken the background (via Project > Project Properties > General) to make the lines stand out more...

This is getting a bit better now, but still not great

Okay, let's now change the colour and introduce some feature transparency and see how this looks:

Definitely an improvement, but not great


Note how this was done, if you don't already know:



So far, so good. But what about the glow effects? That's where feature blending mode comes in - as you can see below:



With a line width of 0.1, transparency of 90% (because I have a couple of million lines here) and a Feature blending mode set to 'Addition' here's what I get:

You may need a different transparency % in your data

What on earth do all the different blending modes do? There's 'Screen', 'Multiply', 'Dodge' and many more but it's not immediately obvious so here's a little summary from the QGIS 2.8 documentation pages on the subject:



To see the different impact each feature blending mode has, it's best to try them - for example, if you want a less 'glowy' version of the previous example above, you could used 'Dodge', as shown below:

Similar to the previous one, but this is 'Dodge'

Of course, you could also decide that you want the lines to be different colours and symbolise them differently based on their length. With this, you take a different approach and it would look something like the image below, where I've used reds:

No feature blending here, just layer symbology and ordering

To achieve the above, you'd have to have a line length field (but that's easy in QGIS) and then color different lengths slightly differently and then use layer ordering. This too requires a good bit of experimenting to get right (and the ones shown here are far from perfect examples) but here's an example from the layer properties dialogue:

Note: click 'Advanced' to see symbol levels

The only other thing to mention is that when you zoom in you'll see things differently and perhaps need to change the symbology to suit the zoom level. You can see this for the example below where I've zoomed in to London and changed the transparency down to 70%:

Now we can begin to make more sense of the flows

If you want to know how to create the flow lines in the first place, check out my previous post on the subject, where I also provide a sample dataset to work with. Once you've got things looking as you want them, you can then add labels and all sorts of other things to make your map more informative. Note that I used QGIS 2.10 here but this should work from QGIS 2.2 and above.



Thursday, 16 September 2010

Filtering Flow Data

My adventures in spatial interaction visualisation continue. I'm currently finalising some more of this work in a paper I'm writing and it gets quite complicated so I've tried to think of ways to simplify the patterns within the vast datasets I've been working with.

The image below shows inter-district migration in the UK for 2001 at different flow magnitudes in a very short animation. This is just one example of the kind of visual things I've been working on recently.



Monday, 19 January 2009

Still working on things

January has been pretty quiet on the blogging front, but that's because I've been working on papers. One of these is in revision and the other is a new piece of work based on my PhD writings (but it's taken on new life too).

Anyway, more on the former. I'm attempting to revise a paper on flow mapping and to make things more interactive and more effective so I decided that I would build a small site in google sites and then put links to content there. So, if you're at all interested in flow mapping, kml, google sites, GIS, spatial interaction or anything closely related to any of these it may be of interest. If not, it does look quite nice.

There's an introductory page, some information about the data, a few colour maps, direct links to kml files overlaid onto google maps and some links to the KML files on my web space. There's also a few words about me and about the project that all this came from. As you can see, I've also added a slightly psychedelic banner. Link to site here.


In future, I plan to blog a lot more on non-flow-mapping-related issues. It's just that for the past year or so this has been a big part of my work. That's all for now...

Thursday, 6 November 2008

Yet another flow mapping post...

The reason for another of these posts is that I've been contacted by various people in different parts of the world (the USA, Australia, England) about flow mapping; how to do it, what to use it for and so on. Well, I think much more development is needed. I also need to keep blogging but I've been busy recently - poor excuse though. So, more results of my experiments in flow mapping... all of which use migration data from the 2001 UK Census.

First we have flow lines for the United Kingdom, at district level and then along the side I show different link magnitudes. This map shows 'gross' flows. That is, the flow lines represent the total link between two places (so, if A to B = 100 and B to A = 50, the gross link = 150).



On the second map, I've shown the same data but at ward level (n.b. there are about 430 districts and about 10,000 wards - as you'll understand, the migration matrices are pretty big). I've had to filter it to show only flows of 12 or more otherwise it's a jumbled mess.


On the third map, I've shown this data just for South East England, in the area surrounding London. This illustrates, to varying degrees of success, the level of functional polycentricity which exists in relation to household mobility.


Finally, I've attempted something different. I've produced a smooth surface raster, based on 2.5km cells, of all ward level migration. In some ways it is a success, but we can never really overcome all the limitations of 2D display. However, it does tell a story.

Wednesday, 16 April 2008

Flow Mapping Frenzy

One of the GIS areas I'm really interested in is flow mapping, or dynamic mapping as some people call it. I did a lot of this in my PhD and am now in the process of writing a paper about it. This is also part of the reason I'm getting into VBA. Here's an example:













This map is an extract from a much, much larger dataset that has nearly 1 million flow lines in it. On the left the image shows inflows to Manchester from 2000 to 2001 and the other one shows outflows from 2000 to 2001. I like to think of this as the migration footprint of Manchester and even though many of the lines represent very little movement, the spatial extent is quite large. The message here, I suppose, is that everywhere is connected to everywhere else, but near places moreso (Waldo Tobler's First Law, anyone?). So, I'm into flow mapping, but only really as one more way of helping us to understand the way our world works. Although, I do have to admit that the nerd in me actually enjoys the technical side of it all too. There's really lots of different ways to do this kind of thing in GIS, but I used ArcGIS 9.x and Alan Glennon's Flowtools. I also hear that ONS are doing something similar to this with their new data visualisation unit - so have to see how that develops in due course.

My next paper is going to be much less technical. My post-PhD publication plan is to get 4 papers from my thesis and so far I've completed two quite technical pieces. Now I want to get back to the actual topic itself (spatial effects of regeneration initiatives in North West England). I might write something here about this soon...