Finding and mapping the center of your world(ish)

This is the center of Preston.

The center of Preston.
The center of Preston.

No really. The exact center of Preston.

I made that discovery as I pondered a post I saw a little while ago.

The article came from The Londonist, who ran an experiment to find the center or London.  It was a repeat of an experiment they did in 2010, things were a bit make do and mend…

We pasted a map of Greater London onto cardboard, cut out the map, and then tried to balance it on a pin-head. The balance point, also known as the centre of gravity, can be said to be the geometric centre of London. 

But for the update they went a bit more high tech.

Step forward Tom Hoban, who’s now refined the method and thinks he’s found the centre of London to much greater precision. Rather than using cardboard and scissors, Tom traced an electronic map in AutoCAD software. He was then able to find the shape’s centre of gravity digitally, removing the imprecision of our balancing-on-a-pin malarky.

I thought the ‘malarky’ of the pin and card was really nice.  Very hands on. But it got me thinking about how easy it would be to work that out for other places.  (that’s how my brain works)

Find the shape

The first challenge is finding the ‘shapes’ of a city to work with.  In these days of data journalism and digital mapping, I wondered if that kind of ‘data’ existed and it does; kind of. There are plenty of data sets that offer shape files; the data needed to ‘draw’ the shape of a city or (more commonly) electoral ward, county or country.  You see these a lot in visualizations of data like voting records etc. So it was just a case of finding one with about the right detail I needed.

The Office of National statistics maintains quite a nice list of  files with boundary information, which have that data included.  I chose  the Boundaries : County_and_unitary_authorities_(E+W)_2013_Boundaries_(Full_Extent).zip file.

Find the centroid!

As you expect these shapes are not uniform, they are polygons, so it took me a bit of Google work to find that the ‘center of gravity’ of  a polygon is called it’s centroid.

In mathematics and physics, the centroid or geometric center of a two-dimensional region is, informally, the point at which a cardboard cut-out of the region could be perfectly balanced on the tip of a pencil, assuming uniform density and a uniform gravitational field.

So it was a bit of piecing together.  I know you could easily map shape files using Google tools like Google Fusion tables etc. and I know that you can do some clever maths using scripting so the next step was to put it all together with more Google around ‘calculate the centroid of a polygon in Google maps‘.  Which, by a country mile,  is the most technical and intelligent sounding thing I’ve googled in the last 10 year.

Some time later…

Cutting a long Google very short, I ended up recognizing that doing it with Google maps was going to be hard – at least beyond my skills.  But my searching revealed that there was some good mapping software or GIS  available that might do the job. What’s that then

A geographic information system (GIS) lets us visualize, question, analyze, interpret, and understand data to reveal relationships, patterns, and trends.

I ended up using QGIS, an open source mapping program that works on PC and Mac.  I won’t lie, it’s a bit of bind to set up.  But once it’s done you have a pretty powerful set of tools and one that would be worth a look  for people doing a lot of mapping .

What’s great about QGIS is that once the ‘polygons’ are loaded in, it has a very neat menu item that calculates the centroids. Instant centers of all the areas on the map in one click!

Here’s a quick how-to:

This is shape file
This is shape file
  • Download and unzip the mapping data. If you look in the unzipped folder you’ll see a file with a .shp extension. That’s the one we want.
  • Open QGIS

QGIS_2_2_0-Valmiera_and_Applications

  • Click the Add Vector Layer button or pick Layer > Add Vector layer from the menu
  • Browser to the shape file (.shp) from the unzipped folder and open
  • A nice rendering of the shape file appears similar to the one below.
Don't worry if your colours are different. It's random
Don’t worry if your colours are different. It’s random Contains National Statistics data © Crown copyright and database right 2013
  • Make sure the layer you have created is selected and the select Vector > Geometry Tools > Polygon Centroids

Vector

 

The system offers a dialouge box. It wants to save the data as a new file. I saved mine in a new folder called centroids but you can put it where you like.  Make sure you check the Add Results to Canvas option or you won’t see the centers.  The result is something like:

Untitled1
Contains National Statistics data © Crown copyright and database right 2013

That’s all the centroids calculated and plotted.

Getting the data on to a google map. 

For a number of reasons I wanted to make sure I could share the results on a google map.  One of the easier ways to to get any complex location data into a google map is to use Google Fusion tables. They play nicely with location information saved as a KML (Keyhole markup language) file.

QGIS makes short work of this.

  • Select the new layer with your centroids in
  • Select Layer > Save As
  • Pick  Keyhole markup language KML from the Format option
  • Select a location and filename to save the content. Make sure you keep the .kml extension.
  • Repeat the process with the original layer (with the local authority areas on it)

The process to get the files in to Google Fusion tables is pretty easy. Here’s a slightly amended version of what Google suggests:

  1. Go to Google Docs. Sign in to your Google Account or create a Google Account if you don’t already have one. (Note that you while can use a Google Apps for your Domain account for Fusion Tables, you will not be able to create maps.)
  2. Click the “Create” button.
  3. Click the “Connect more apps” bar at the bottom of the resulting list.
  4. Type “fusion tables” in the “Search Apps” box and hit the “Enter” key.
  5. Click the blue “+ CONNECT” button, then click the “OK” button in the confirmation dialog box.
  6. Click “Create > Fusion Table (experimental)”.
  7. In the Import new table dialog box, click “Choose File”.
  8. Find the KML file you created from  QGIS
  9. Check that the data is formatted correctly and click “Next”.
  10. Give your table a name and click “Finish”.

Once it’s imported you can click the Map tab and you’ll see the elements mapped (either the outlines of the areas or the dots that represent the centroids.

You can embed the map straight from google fusion tables like this

Or you could use something like the Google Fusion Maps Wizard to mix together layers into one map. Like this:

Once you have it on a map you can also take advantage of the satellite view and the Street view tool on google maps to get a good look at the center of your world.

Conclusions

This may all feel like a sledgehammer to crack a pointless nut! I guess it is. It’s a bit of fun that spiralled. The best I could say is that it falls in to my find a tool that answers a question methodology.  But here’s some observations and what I learned  along the way:

  • The center really does depend on the boundaries you pick. The picture at the start of this post is based on the Urban Audit of Greater cities boundaries for Preston (data). That’s different from the center that the Unitary and Borough boundaries throws up. (that’s in a field just near the M55 junction on the M6)
  • Picking the The Full Extent version of the files does skew things a little as it describes the shape of an area even if some of it stretches into the sea! So the methodology isn’t rock solid on a number of counts
  • There are lots of data sets to play with. Qgis means you could load loads up and compare.
  • Using QGIS ties you to the desktop – not great if you’re in newsroom with locked-down IT.
  • Using QGIS opened my eyes to the power of GIS software in general and how it could be part of a data journalist’s toolkit. But if you’re doing a lot of data mapping (rather than mapping) I do think something like Tableau is the better place to focus your time.

Finally, and most importantly I’m bound to repeat that all of this post contains National Statistics data © Crown copyright and database right 2013

 

Creating Instafax style video on your ipad? Harder than you’d think

20140227-150324.jpg

Earlier in the week I wrote a post about making instafax style video using free stuff online. A few commentators, on and off the site, suggested that this would be the kind of thing you could do with your ipad.   So I thought I would take a look.

The short answer is: You’d think it would be easy. Actually it’s a bit of a pain.

The first step is finding a way to make the image/text side of things,

Making nice images.

I tried a few apps to see if I could get that combination of editing (cropping and image manipulation) and text that I got from Pixlr.

A neat solution to the image manipulation and cropping came from Aviary. Their app has a neat crop tool and the image manipulation/filter tools are nice to play with. But Aviary’s text tools are pretty limited. You can add text but it’s limited by size and is always center aligned. Not quite what I want.

I also had a look at the Instagram focused end of the market.  One app that I liked was AfterPhoto. It crops to a square ratio but the text tool is limited to one line at a time. What makes up for that limitation however is the ability to add ‘layers’ of text. Another option was Over. It shares a similar style of editing with Afterphoto but the text tools are pretty flexible. It’s not free though.

As it turned out Pixlr was also the solution to the problem on ipad as it was on the web, with it’s PixlrExpress app.  Square cropping, nice text and image manipulation Well done Autodesk! The only thing to remember with PixlrExpress is apply all your filters etc. before you add text!

Being positive about it, you could say that you’re spoiled for choice when it comes to image editing apps on the ipad. You could range around and cherry-pick the nice fonts and filters from a number of them.

Making the video

There are surprisingly few, useful, free apps for video editing on ipads. ‘But wait a minute Andy’ you cry. ‘What about  imovie’. Technically you could say that’s cheating anyway as it’s only free if you happen to own a swanky new ipad. The rest of us chumps paid for it! But it’s nice and swish.

Sadly it falls at the first hurdle. In Apple’s cuddly style it demands that any stills fill the screen and are animated to make them dynamic and interesting. Now I love a good Ken Burns effect as much as the next man but it’s not what we want here.

Another issues is that you can’t set the resolution of the video clip (you cant set a custom width and height) so any video produced would be cropped by instagram. iMovie Fail!

In terms of other video editing options, it’s slim pickings. There are a few  free video editor that I tried but most failed when it came to keeping the images in the right resolution.  Some did but watermarked the video. In one way that was less of a problem as instagram actually crops it out. But that’s not the most ethical or fair way to go.

The best solution I found was an app called Flipagram. A very neat app that will quickly build up a slideshow for you. It has the added bonus of allowing you to record your own narration. That could be a real plus-point for those looking to leverage the audio-slideshow style of narrative. The downside is that it does add a watermark.

And the result…

But what about adding video…

If you do want to mix video and images (and have both behave in terms of resolution) then, I’m afraid, you’re paying for an app.   Even if you pay, as I said before, it’s slim pickings.   The big problem, as far as recreating instafax goes, is that the text tools on most editing apps are risible.

If I had to recommend an app (and a workflow) it would be a combination of VideoCrop (free) and Pinnacle Studio.(£8.99). Use video crop to crop the video to the right format and then use Pinnacle to piece it together. Pinnacle respects the aspect ration of the video and images you use so any video you output should crop nicely in Instagram.  Be prepared to wrangle with the tools though (especially text and the mystical composite setting). It’s a steep learning curve.

Conclusions

So it is possible to recreate my original experiment on an iPad using free tools. But the process underlined for me that the assumption that your iPad/smartphone/tablet, is a multimedia power house is pretty wide of the mark.  Moving outside the TV box with video is a case of moving around apps. A combination of tools will get the job done but as with most things, money buys you flexibility.

That said, if image slideshows is your thing then the Pixlr/Flipagram combination is a winner in my books.

Let me know what you think.

Pyramids and the shape of news

I saw a tweet a few days back from my good friend Paul (@digitaldocs).

If the news was a shape - what shape would it be?
@digitaldocs
PaulEgglestone

I replied that it was either a square or ‘a messy blob’

Thinking about it later I wondered why I didn’t immediately say pyramid. My immediate thought was box. So much for thinking outside of it!

Talk about burying the lead!

In that way the web has, I felt an echo of that as I read this article on the BBC website

Seventeen lost pyramids are among the buildings identified in a new satellite survey of Egypt.

Perhaps it was the idea that new technology would unearth these monuments to an older way of life. Maybe it was the irony that these seemingly impervious icons of an older way of life would just dissapear without anyone knowing.

All that effort, all the reason for them being there in the first place, forgotten.

 

iphone app idea: iwall

A few tweets from Sarah Hartley gave me an idea for an iphone app:

My mock up of iwall
My mock up of iwall

I’m going to call it iwall and it’s specially designed to give you a portable bit of wall to bang your head against when you are in a meeting.

Taking advantage of the tough build quality of the iphone this little app takes the innovative step of bring the wall to your head rather than your head to the wall. The app will display a high-quality picture of a wall for you to bang against your head and can be set to emit a realistic head on brick sound.

How much shall I charge?

Reblog this post [with Zemanta]

Google: A future Champ

The slight disruption is service has been down to a music festival – very good – and quick visit to the lakes to celebrate my mum’s 60th.

Whist up there I came across one of those ‘guide to the web’ books from 2000 and this page caught my eye

Google, a future champ
Google, a future champ

A nice Google Beta(!) screen shot and text that reads

Google is a highly promising newcomer, with a large database, an intelligent system of ranking hits by relevancy(popularity), and local cache access to pages that have disappeared since its crawl or are otherwise unavailable.Check it out, as it looks set to become a future champ

That was 8 years ago…

Reblog this post [with Zemanta]

The Parrot theory

In any line of work there are rites of passage. Sometimes it’s the trial you have to go through to be excepted by your peers – like being sent out for tartan paint or a left handed hammer. Other times its the jobs that just make you groan. ‘not again’.

In journalism its the stories that crop up that can mysteriously clear a newsroom leaving a rabbit-eyed intern right in the firing line. The prime suspect for that ‘groaner’ is usually a vox-pop (for snappers it’s the big cheque picture) but in online I’m sure that it’s the parrot story.

Now I haven’t done any empirical studies on this. I base this purely on a rough bit of googling. But the thought came to me when I watched the Croydon Advertisers video on Frisco the talking parrot.

What a great little video. A nice treatment of a traditionally duff story.

So remember it may be parrots catching burglers, prediciting earthquakes or even revealing affairs but one day you will be sent on a parrot story. Are you prepared?

Reblog this post [with Zemanta]

What is a citizen Journalist?

This made me smile. Not saying I agree. Just made me smile.

A definition of citizen journalist by Seth Finkelstein in response to a post by Dan Gillmor about defining the loaded term

“person who wants to have things both ways, by claiming all the privileges which attach to the role of “journalist”, while disclaiming all the responsibilities and rules which constrain that role, saying they are a “citizen””.

Reblog this post [with Zemanta]

Have you got my number Ray…Number10tv goes online

So Number10 has gone online with a wordpress powered website and a brightcove powered TV channel number 10tv. It’s all flickr and community orientated. Looks good.

With my video head on I’m very excited as they have obviously gone for the TV-format approach. Whilst the TV does series from a Zoo and a wildlife park, Number 10TV does ‘Kestrel Rescue’

Cue exciting music and last minute errands of mercy all held together with Gordon Brown doing his best Rolf Harris Animal hospital routine?

No. Cue this (listen to the sound)

So, Ray. Are you sure you have the number? ‘Cos it’s changed.

History lesson.

Wife!
Wife? Check.

I also enjoyed the feature on Winston Churchill. I particularly like the section on wife. Yes he had one and she was “tall, stately and handsome” which I’m sure is a description that would earn you a slap, even in polite society.

Given the tone of the section I think Number10 have inadvertantly raised the veracity of wikipedia as a source.

Make your own bluescreen.

I would normally stick this in my daily links but one of the comments made me smile and it’s cool, so I thought I would share.

Now you can present the weather in your own home
Now you can present the weather in your own home

Theodore Watson is running what sounds like a fantastic class called ‘The Make Class’. It’s about “making stuff! It is also about sharing the process!”. They make everything from Helicams to sex toys! Brilliant.

With all the talk about teaching innovation and creativity, this sounds like the kind of course I’d love to take.

Anyway, the project that caught my eye was the portable blue screen and he shares how on his blog and on Instructables

And the comment that made me laugh? Instrcutable member sciamannikoo offers an alternative.

1. take a second hand laptop
2. Install any MS system
3. Delete few system files (with Vista you don’t even need this step)
4. Enjoy your blue screen 😉

Thanks to FreshDV for the tip off