[Qgis-developer] Batch generation of map images with MTR

Nathan Woodrow madmanwoo at gmail.com
Wed Nov 5 15:02:11 PST 2014


Hey Richard,

There is a new class you can use for the rendering because we now have MTR
you have to wait for the image, or listen for the done event.  The code is
pretty easy and you can see an example of me using it here:

 https://github.com/DMS-Aus/qgis2img/blob/master/qgis2img/render.py#L43

The basics are:

    job = QgsMapRendererParallelJob(settings)
    job.start()
    job.waitForFinished()
    image = job.renderedImage()

settings is a QgsMapSettings class which you can make or take from the
canvas using iface.mapCanvas().mapSetttings()

QgsMapSettings has a list of layers to render so you can update that
without changing the layers on the canvas, it's very handy.

Give that a try and see how you go.

- Nathan


On Thu Nov 06 2014 at 1:30:54 AM Richard Burkmar <rich.burkmar at gmail.com>
wrote:

> My apologies - I didn't check the latest version of MMQGIS so my statement
> that the animation feature doesn't work with the latest version of QGIS was
> incorrect. It seems that they have solved the problem that I encountered,
> so I'll take a look at the code there.
>
> (I hope that this message comes out in the correct thread - I couldn't see
> how to do it, so I'm sending a message with the same title. I'm new to
> these mailing lists.)
>
> Rich
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20141105/50d36672/attachment.html>


More information about the Qgis-developer mailing list