[Qgis-user] Print one map for every category in layer with fixed extent

Blumentrath, Stefan Stefan.Blumentrath at nina.no
Fri Feb 3 08:47:46 PST 2017


Thanks Andreas for the excellent procedure description.

Good to know that Python is not required for that, and that there is a nice, flexible, and efficient solution!

For someone who uses QGIS on a regularly basis, this is actually much less work than it might seem at a first look.
However, I am afraid, if I imagine that I try to explain that to my colleagues, many would not be able or not willing to follow, I am afraid…

I found some more code snippets online, which I compiled into a small script. That could be easily wrapped into a plugin if none exists for that yet…??

Cheers
Stefan

From: Neumann, Andreas [mailto:a.neumann at carto.net]
Sent: torsdag 2. februar 2017 15.05
To: Blumentrath, Stefan <Stefan.Blumentrath at nina.no>
Cc: Qgis-user at lists.osgeo.org; Terje Blindheim <terje at biofokus.no>
Subject: Re: [Qgis-user] Print one map for every category in layer with fixed extent


Hi Stefan,

It is possible without the help of Python.

You would have to split up the species into layers.

Then create an atlas layer that is the geometry you want joined with every possible layer. You can use QGIS virtual layers for that which you can define in DB manager. Or use a Postgis view for it.

So for each geographic unit you want to print you need a combination with each layer you want.

E.g.

Province 1 - Species 1

Province 1 - Species 2

Province 1 - Species 3

Province 2 - Species 1

Province 2 - Species 2

Province 2 - Species 3

In this layer, the geometry is redundant, but since you can use Postgis views or virtual layers, it is only virtually redundant.

-------------

Finally, in print composer you would use data-defined layers or visibility presets based on attributes in the atlas coverage layers.

I did exactly that - print an Atlas for several districts in my city and a loop of historic maps. For each district I printed around 15 different historic time snapshots (old maps).

Hope this helps to get started.

Andreas

On 2017-02-02 11:21, Blumentrath, Stefan wrote:
Dear all,

In a project I like to produce a sort of species distribution atlas, where I like to print out (export to image) a map from the print composer for every species recorded within one and the same municipality.

So, the map extent should not change and layout is fixed too. With these things fixed, I want to get a map for each single species mapped and thus also legend entries change. The species are in one single layer, but I could also split them if that makes it easier.

Is there a function in Atlas for that which I overlooked or a plugin or the like.
If not, is there any Python code I could repurpose for that? Found only this [1] and [2], where [1] does not work…

But before I start looking into a pygqis solution I like to make sure that this feature does not exist yet…
This is a not uncommon use case in ecology btw., so a built in function would be neat.

I am grateful for any hint.

Kind regards,
Stefan

[1] http://gis.stackexchange.com/questions/183589/using-pyqgis-to-create-images-from-the-qgis-print-composer-each-showing-a-differ
[2] http://kartoza.com/en/blog/how-to-create-a-qgis-pdf-report-with-a-few-lines-of-python/


_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org<mailto:Qgis-user at lists.osgeo.org>
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20170203/fc6df91b/attachment.html>


More information about the Qgis-user mailing list