[Qgis-developer] Atlas export Python script not working in 2.2

Nyall Dawson nyall.dawson at gmail.com
Thu Feb 27 11:50:26 PST 2014


A couple of points:

- first, make sure you are using the QgsAtlasComposition which is created
by the composition, rather then creating a new one.  Ie,
myAtlas = QgsAtlasComposition(myComposition)

Should be:
myAtlas = myComposition.atlasComposition()

Then, as Hugo mentioned, you need to activate the atlas by calling:

> I think it is myComposition.setAtlasMode( QgsComposition.ExportAtlas )
>

You should be good to go after this.

While QgsAtlasComposition::setComposerMap and setFixedScale, etc have been
deprecated, they should still work OK. As mentioned earlier, the new way is
to set these properties directly on the QgsComposerMap by setAtlasDriven
and setAtlasFixedScale.

> You can have a look at test units in :
> tests/src/python/test_qgsatlascomposition.py (which ... apparently are
> failing now ...)
>

+1 to this, the python tests are a good way to see examples of the qgis api
in action. I suspect they are failing either due to platform specific font
rendering issues or due to MTR changes. I'll take a look at these in the
next couple of days.

Nyall
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20140228/0f983b62/attachment.html>


More information about the Qgis-developer mailing list