5

I am looking for a way to use the QGIS plugin "Time Manager" to animate a polygon shapefile.

I have a polygon shapefile that has a field of population per year for each feature and I want the plugin to display the data year by year.

COUNTY_NAME / 2001_POP / 2002_POP / 2003_POP
Madison / 1500 / 2000 / 3000
Guilford / 1500 / 3000 / 4500

I have found tutorials that explains how to do it with a point layer, but none with polygons.

Any idea?

3

Tutorial based on point should work as well as for polygon. But before anything else you must normalize your dataset so that time manager can use it.

You should transform your data to fit this layout:

COUNTY_NAME / TIME / POP
Madison / 2001 / 1500 
Guilford / 2001 /1500 
Madison / 2002 /2000 
Guilford / 2002 / 3000 
Madison / 2003 / 3000
Guilford / 2003 / 4500

This can be pretty easy or straightforward depending on the tools you are using and if geom data is included or joined to your dataset. You'll have to repeat the geometry feature for each row/date. This is almost another question and might have been answered before in another thread.

And also you must convert this newly created time column to a timestamp format (or any other format accepted by time-manager if there is any).

COUNTY_NAME / TIME / POP
Madison / 2001-01-01 00:00:00 / 1500 
Guilford / 2001-01-01 00:00:00 /1500 
Madison / 2002-01-01 00:00:00 /2000 
Guilford / 2002-01-01 00:00:00 / 3000 
Madison / 2003-01-01 00:00:00 / 3000
Guilford / 2003-01-01 00:00:00 / 4500

Then you are good to go you'll just have to experiment around and set the correct parameters.

  • Hi there, I'm just checking in with this answer, since QGIS has developed a lot in the last 2.5 years. I've got the same question, the structure of my data is as follows: I have 1400 (NUTS) polygons x 72 columns. Each column represents monthly data x 6 years (72 colunms). Do I need to reformat my data to 3 column (identifer, value and timestamp) x 100,800 rows (1400 x 72). Seems like quite a lot of duplication particularly of geometry? Am I missing something? Thanks in advance. – SamFranklin Apr 30 '18 at 16:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.