[Qgis-user] Maps generation with Python (or Atlas ?)

DelazJ delazj at gmail.com
Mon May 18 09:09:52 PDT 2015


Hi,

2015-05-18 17:51 GMT+02:00 Benoît Laurent <blaurent at heurisis.eu>:

> Hello,
>
> I would like to generate a series of maps representing tracks with stops
> along them.
>
> For each track, I have got a group of two layers, one for the linear, one
> for the points that have associated information (basically name and time of
> the stops). First, is there a better way to achieve this ? For the moment,
> I have to handle two types of layer. It is the beginning of my problems.
>
> As the tracks overlap, I would like to generate a map for each track where
> only the current selected track appears. The others would be hidden.
>
> I had a try with Atlas generation. It perfectly works except that I can't
> hide the other tracks.
>
>
You can style your coverage layer so that only atlas current feature will
appear. In categorized style, use an expression like $id=$atlasfeatureid.
You'll get 0 (false) and 1 (true) when classing. Set the 0 features style
so that they become invisible or transparent.


> I also had a try with a Python script. I managed to iterate over the
> groups of layers but I can't refresh the map canvas during the Python
> script. So, it doesn't work.
>
> A snippet of your code may help but I remember I had to face such a
problem and it was because after *myatlas.beginRender()*, I forgot to set
active the export of the atlas, sthg like
*mycomposition.setAtlasMode(QgsComposition.ExportAtlas)*


> Do others faced a similar problem ? Any help would be appreciated.
>
> Regards,
>
> Benoît
>
>
>
> ---
> L'absence de virus dans ce courrier électronique a été vérifiée par le
> logiciel antivirus Avast.
> http://www.avast.com
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20150518/8b5e0d17/attachment.html>


More information about the Qgis-user mailing list