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

Neumann, Andreas a.neumann at carto.net
Thu Feb 2 06:05:03 PST 2017


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 [1] 
> 
> [2] http://kartoza.com/en/blog/how-to-create-a-qgis-pdf-report-with-a-few-lines-of-python/ [2] 
> 
> _______________________________________________
> Qgis-user mailing list
> 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

  

Links:
------
[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/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20170202/9d7358ab/attachment.html>


More information about the Qgis-user mailing list