Step 1 - Shape file
First you need to find a shape file. This is a file that will tell Google fusion tables what the boundaries will be on your map. These might be American states or English counties. In this example, we are going to use UK constituencies.
To get hold of this you will need to go to the Office for National Statistics geoportal. Click on the 'download products' tab.
The file we want is called:
Boundaries : Westminster_parliamentary_constituencies_(E+W)_2012_Boundaries_(Generalised_Clipped).zip
(Generalised and clipped just mean it is not the most detailed file that is available. This is fine for our purposes.)
Unzip the file and you should get a folder with a few different files in it that looks like this.
Don't worry, just save it somewhere for now.
Step 2 - convert shape file to KML
This is the file type that google fusion tables like. To do this you will need to go to a site called Maps Data and head to the file converter tab.
Now just drag that whole folder into the box that says 'convert file to KML'.
You should then be able to download a single file that google fusion tables will like.
Step 3 - make a fusion table
Now open up google drive and create a new fusion table. You might need to download it as an extra app if you don't have it already. Do do this, click on this little button:
When you create the table it will ask you where you want to get the data from. Choose the option upload from computer and find your new KML file.
Fusion tables will know what to do with it and will automatically generate a map. It will look like this.
As you can see, it has identifies the boundaries to the constituencies.
Step 4 - get some data
I am going to use some recently released data about numbers of claimants of Job Seekers Allowance. You can find this on the Office for National Statistics website under the 'data' tab.
This is a good fit because it concerns constituencies, so it matches our shape file. The file should be a Microsoft Excel spreadsheet file (xls).
Step 5 - Make a second fusion table
Drag and drop this xls file straight into your google drive window and it will upload. When it appears, right click it and choose to open it in google spreadsheets.
At this stage you might want to clean your data, removing any columns/rows that you don't need. I am choosing to only use London constituencies, and I am only looking at the '% of population claiming' for now, so everything else goes.
IMPORTANT - Do not delete the column with the codes 'E14000540' etc. These tell fusion tables where these places are. Now it looks like this:
Now make another fusion table, this time using this new google spreadsheet.
Step 6 - Merge the tables
It's time to cross the beams. On either of your fusion tables, click on file> merge tables, and choose the other one.
Now you need to find which column in each table contains the area codes. This is how fusion tables match up the statistical data with the geography, and this is the most important step, so don't get it wrong.
The new merged table will automatically generate a map. You should now be looking a groovy little map of London with the constituencies mapped out.
Step 7 - Configure the map
So now it's time to make the different regions change colour to represent their data. Click on 'Change feature styles'.
Now select polygons, and choose 'fill colour'. Then choose 'buckets'. To make your life easier, click on 'use this range' and it will work out what the range your '% of people' column has. (If this column is not selected, select it now. Then divide it into three buckets and chose some colours!
I have chosen three buckets and green, amber and red to represent the numbers, but have a play around. You can also tell it to draw outlines instead, and you can use just one colour with a gradient. These options will be suited to different kinds of data.
Now it should looks like this.
If you want to change the information in the info window, click on the 'change window info' underneath the 'change feature styles button. from there you can delete columns that aren't helpful. You can also rename column headings on the spreadsheet tab to make things clearer.
Step 8 - embed your map
And this is what you should end up with, an interactive map that you can embed within any website or blog.
Click on the regions for more info!
Here is a key so you know the values I eventually went with.
No comments:
Post a Comment