Creating animation from FUTURES output in GRASS GIS
This is a tutorial how to create an animation from the output of WxGUI Animation Tool ( . Not all steps from the tutorial might apply to you case depending on how your input data are structured, which color tables you are using and what static data you wish to add to the animation.addon module which is a part of , an implementation of FUTURES model. It uses GRASS temporal framework to get the output time series into a spatio-temporal dataset which is then used as an input for the
Setting a color of the initial development raster to match the outputs
First, convert the initial development into same classes as output from(1 for developed, NULL (NoData) for everything else. For this task we can use raster algebra, for example:
r.mapcalc "development_initial = if(lc96 == 0, 1, null())"
Now, let's set the color table using interactive raster color management tool (a wrapper aroundmodule). The tool is in Raster > Manage colors > Manage color rules interactively.
The tools lists individual categories and we can set the desired colors. If desired, we use the pipette tool to get the color from areas in an existing raster already shown in the Map Display.
Other raster maps which we can show afterwards together with the animation, might need some polishing of color table. In some cases it advantageous to copy the raster map into a current mapset using right click on the raster layer in Layer Manager and select Make copy in the current mapset in the context menu.
Creating spatio-temporal dataset from the output
The Animation tool can work directly with the rasters, however it is more advantageous to register all the rasters in the time series into the temporal database. Start by creating a spatio-temporal raster dataset:
t.create output=futures_development type=strds temporaltype=absolute \ semantictype=mean title="Development" \ description="Development time series generated by FUTURES"
Note that backslashes mean that the line continues on the next line. This syntax works in unix-like command lines. In the GUI Command Console, just put everything on one line without any backslashes.
Now, get list of all map layers in time series generated by
output_series=futures_development when we were running the module):
g.list type=raster pattern=futures_development_*
This will create a list of raster maps; each name at one line. Add the initial development at the beginning to complete the list:
development_initial futures_development_00 futures_development_01 ... futures_development_33 futures_development_34 futures_development_35
You can prepare the list of rasters in a (plain) text editor and use the file as an input for
file option. In any case, the command should be similar to this one:
t.register input=futures_development@futures_test \ file=.../.tmp/fatra/5311.19 start=1996 unit=years increment=1
Start GRASS GIS Animation tool from main menu File > Animation Tool (or from command line). Then find Add new animation button in the toolbar and press it.
Similarly to the Map Display the animation tool can show many different static layers. These can be raster or vector layers or various special layers. However, the main purpose is the show time series. A time series can be, for example a series of raster maps (like the original output from). This would require adding all the raster maps individually in the right order. This might be easy for short time series but it is tedious for large amount of maps. We have already registered the output from as a spatio-temporal dataset, so we can simply use just this dataset. Set Input data type to Space-time raster dataset and then select the dataset we created earlier.
As mentioned above the animation tool can show also different kinds of static layers (which won't change during the animation).
The colors for vector are typically managed when displaying the layer and this is also the case for roads vector. Unlike other properties the opacity is managed separately in the list of layers.
Rendering animation takes some time and thus the rendering is not triggered automatically when changing the size of the window. As a result, we need to press render button in toolbar when we changed the size of the window.