Im looking at making a standalone script, that on execution will run the QGis MapComposer using a previously generated template and output a PDF/PNG of the map. This process of making a map will be the last step in a operational system that runs twice daily.
I considered using the --snapshot function, but because I'd also like to have a number of images (logos etc) on the layout, the snapshot becomes unworkable.
In essense, what I'd like to do is: From a standalone script, save a PDF or PNG that is based on a qpt-template-file. For each run of the script, I'll have a new .tif file, which I can write into a qgs-project-file, in order to load the right file. With this, what I expect that I'm supposed to do is:
(1) initialize Qgis
(2) open up the qgs-file (in order to specify file, stretch etc)
(3) open up the map composer with the qpt-file (in order to have all my static images, labels etc)
(4) save the map to a PDF / PNG (format is of little concern)
(5) close Qgis
What I've been having trouble with, is steps 2 and 3. Steps 1, 4 and 5 I've grabbed from other scripts and various examples. The pyqgis cookbook doesn't really cover the parts that are troubling me, and API Documentation is significantly out of my league.
Is anyone here willing and able to give me a hand with my problems, either by pointing me at the right functions, or by providing a script doing something along the lines of what I wish to do?