Nice Animations with Time Manager’s Offset Feature

You probably know this video from my previous post “Tweets to QGIS”. Today, I want to show you how it is done.

After importing the Twitter JSON file, I saved it as a Shapefile.
Every point in the Shapefile contains the timestamp of the tweet. Additionally, I added a second field called “forever” which will allow me to configure Time Manager to show features permanently.

A "forever" field will help with showing features permanently.

To create the flash effect you see in the video, we load the tweet Shapefile three times. Every layer gets a different role and style in the final animation:

  • Layer “start_flash” is a medium sized dot that marks the appearance of a new tweet.
  • Layer “big_flash” is a bigger dot of the same color which will appear after “start_flash”.
  • Layer “permanent” is a small dot that will be visible even after the flash vanishes.
Three layers with different styles will make the animation more interesting.

styling the tweet layers

We’ll plan the final animation with a time step size of 10 seconds. That means that every animation frame will cover a real-world timespan of 10 seconds.

We configure Time Manager by adding all three tweet layers:
Layer “start_flash” starts at the orginal time t. Layer “big_flash” gets an offset of -10 seconds, which means that it will display ten seconds after time t. Layer “permanent” gets an offset of -20 seconds and ends at time forever.

Layers can be timed using the "offset" feature.

Finally – in Time Manager dock – we can start the animation with a time step size of 10 seconds:

Use a time step size of 10 seconds so it fits to the offset values we specified earlier.

Besides watching the animation inside QGIS, Time Manager also enables you to export the animation to an image series using “Export Video” button. Actual video export is not implemented yet, but you can use mencoder on the resulting image series to create a video file:

mencoder "mf://*.PNG" -mf fps=10 -o output.avi -ovc lavc -lavcopts vcodec=mpeg4

Time offsets are a new feature in version 0.4 of Time Manager. You can get it directly from the project SVN and soon from the official QGIS repo.

12 thoughts on “Nice Animations with Time Manager’s Offset Feature

  1. Pingback: GIS-Lab Blog» Архив блога » Новости вокруг 62

  2. Awesome stuff, I have a question for you:

    How would you change anything if let’s say you have fixed locations (city reduced to a single point) and you’re trying to look at the amount of tweets per time interval per city. You layout the map of Europe and reduce the major cities to nodes. Then I assume you have to normalize the data somehow. Finally at each flash, the circles should be dimensioned based on the amount of tweets done at that time interval for that location

    • Thanks Dassouki! My first idea would be to have one point per city and time interval. The number of tweets could be used as a size scale field for the city symbol. I’m not sure if normalization is really necessary. I’d give it a try without first. Great idea by the way! Are you working on something like that?

      • Yes I am, after your reading your blog post, I thought it would be a great idea to do it for my traffic counts. I just finished binning 50 sites at 30 minute counts for the last year. My GIS.se question, I wanted to add ambient time of day to the raster, that way when you see lots of lights from traffic flashing up you can tell what type of light there was outside, especially since the winter sun is around 10 hours versus summer is around 18

  3. Very cool stuff, thank you.I am testing it as a visualization / presentation tool showing infrastructure maintenance schedules. My time data is over 3 years so trying to get the right interval settings for the best impact – any suggestions?

    • That would depend on how long a single maintenance task takes and how many of them you have within this 3 year period. Also, what kind of effect do you want to achieve? Should it look like there is something going on all of the time? I find that it usually takes quite a while to find a combination that works for me.

      • The Maintenance Task doesn’t have a duration. Each asset is flagged to be due for maintenance on x date. Some require maintenance every year, some only once every 3 years – my PostGIS database sorts out the Maintenance Schedule. I have managed to get each asset to appear (as a dot) when it is due for Maintenance and the resultant clip runs for about 1 minute. I have tried applying the same technique as your Twitter example but I don’t get the flashes working. When you set the offset in seconds is that the offset in terms of the clip timeline or the data timeline? I will play with it some more but some guidance would be appreciated

      • The offset is meant to be on the date timeline and it has to be specified in seconds. The offset will depend on your time step size. (In the example I had a time step size of 10 seconds and offsets of -10 and -20.) Are you showing one day per time step now?

      • I am trying different scenarios using various steps sizes and offsets. I am going to apply it to the phased construction of a water reticulation scheme so that the video will show the planned schedule for pipes, dams and boreholes. I think it will be very useful when presenting our results to non-technically minded stakeholders.

  4. Pingback: Visualizing recall signatures for Scott Fitzgerald | It's academic

  5. Pingback: Visualizing recall signatures for Scott Fitzgerald | Eric Compas

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s