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

Blumentrath, Stefan Stefan.Blumentrath at nina.no
Sun Feb 5 11:41:42 PST 2017


Hi Alexandre,

Currently I have a layer per species, but species could also be in one layer with names of the different species in the attribute table…

I already compiled a little Python script for my use case, however, if there is an existing function for that is better of course…

Thanks for helping.

Kind regards,
Stefan

From: Alexandre Neto [mailto:senhor.neto at gmail.com]
Sent: søndag 5. februar 2017 19.59
To: Blumentrath, Stefan <Stefan.Blumentrath at nina.no>; Neumann, Andreas <a.neumann at carto.net>
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


In the layer, where is the species recorded? In Columns?

If so, I have a workflow for that.

A sáb, 4/02/2017, 08:38, Blumentrath, Stefan <Stefan.Blumentrath at nina.no<mailto:Stefan.Blumentrath at nina.no>> escreveu:
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<mailto:a.neumann at carto.net>]
Sent: torsdag 2. februar 2017 15.05
To: Blumentrath, Stefan <Stefan.Blumentrath at nina.no<mailto:Stefan.Blumentrath at nina.no>>
Cc: Qgis-user at lists.osgeo.org<mailto:Qgis-user at lists.osgeo.org>; Terje Blindheim <terje at biofokus.no<mailto: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



_______________________________________________
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
--
Alexandre Neto
---------------------
@AlexNetoGeo
http://sigsemgrilhetas.wordpress.com
http://gisunchained.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20170205/1c0fbe0d/attachment.html>


More information about the Qgis-user mailing list