I would like to create an animation from a set of PNG files and apply labels (time lapse values) on each of the PNG files. The PNG files were actually heat maps that were generated by interpolation.
I have created the heat maps in 2 steps:
- I Created a QGIS a vector layer that stores timestamp and temperature value pairs for several points on the map. I also added in the vector layer a time stamp for each data point. The header looks something like:
point1, lat, long, time1, temp11, time2, temp12, ......
point2, lat, long, time1, temp12, time2, temp22, ......
- I interpolated each vector layer point for each time stamp (time 1, time2 etc) in GRASS using v.surf.icw that resulted in creating one raster layer for each time stamp, that I exported as a PNG files.
I combined all the created images in a movie with the GRASS 7 GUI animator. Everything looks good except that I would like to have the time lapse label printed on each slide/frame.
In order to add the labels on the slides, I would like now to create a script that reads the time values from the vector layer that was detailed above and write/print the selected values then on the PNG images.
One way I found is to use d.text in grass as documented here. However, this example only shows how to create new slides but not how to write on existing ones. In addition, the time stamp information needs to be extracted/read from the vector layer. I assume with d.vect or something similar may work.
Therefore my question about how put a label on a animation slide has two aspects:
- Extract an attribute value from a vector layer?
- How to write the value of the attribute with d.text on an exiting PNG image?