[GIS] Animate polygon shapefile using QGIS time manager

animationqgistimemanager

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, such as https://www.qgistutorials.com/en/docs/3/animating_time_series.html, but none with polygons.

Any idea?

Best Answer

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.

Related Question