4

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?

4

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.

1
  • 1
    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
1

Also look into the QGIS Temporal Controller, a built-in version of the Time manager plugin. If you have time-aware layers you can make the symbology and layers represent it.

(This example is points, not polygons, from a file repeating common IDs but different timestamps. It is possible to have a virtual layer that joins spatial and temporally varying data, but that's a different problem-- see the "QGIS Creating Virtual Layers" docs at https://docs.qgis.org/3.10/en/docs/user_manual/managing_data_source/create_layers.html )

Here's a snapshot of the QGIS 3.14 Layer/Properties/Temporal on a date field with a DateTime field selected as the Configuration/Single Field with Date/Time:

QGIS Layer/Properties/Temporal configuration

Then use Project/Properties/Temporal to enable the project time extents and calculate them from the time-aware layers:

Project/Properties/Tempora

Then enable the View/Panels/Temporal Controller

enter image description here

Then use the time-aware information to control/override the symbology or labels under Layer/Properties/Symbology/Simple Marker/... (here I'm using the yellow boxes to the right of the fields to do a "date defined override" of the marker size and color with a field from the time-aware layer)

Layer/Properties/Symbology/Simple Marker/Color/Data Defined Override

...and Labels with Layer/Properties/Layer/Single Labels/Value:

Layer/Properties/Layer/Single Labels/Value Then with the temporal controller you can see different time-slices of the symbology or label attached to your data:

Temporally-controlled symbology

Temporally-controlled symbology and labels

To automate storing the results, you might look into using a `Project/Layout Manager/ with an "Atlas" per https://medium.com/@tjukanov/geospatial-animations-with-qgis-atlas-995d7ddb2d67

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.