[Qgis-user] Layer driven Atlas

Thomas Colley it087 at neath-porttalbot.gov.uk
Wed Mar 2 05:33:13 PST 2016


Hi Andreas

That’s excellent, thanks so much, I never thought about joining tables. The virtual layer works really well.

Again I’m not sure if I’m doing something wrong or a bug but some of the atlas variables aren’t working as expected:

atlas_feature and atlas_featureid return <feature: 0> and 0 respectively no matter which atlas page you’re on. atlas_featurenumber, atlas_filename, atlas_pagename all work as they should.

I have got round this by using atlas_pagename (set using the name attribute) in the data defined layer settings (I had been trying attribute(  @atlas_feature , 'name')).

Cheers

Tom

From: Qgis-user [mailto:qgis-user-bounces at lists.osgeo.org] On Behalf Of Andreas Neumann
Sent: 01 March 2016 20:12
To: qgis-user at lists.osgeo.org
Subject: Re: [Qgis-user] Layer driven Atlas

Hi Thomas,

You will need a table with a record per page for the atlas coverage layer.

So if, f.e. you have a table with administrative units (with geometries) and a table with temporal layers (e.g. an ortho-image every 5 years or so) you will need to do a cross-join between the two tables.

See http://www.tutorialspoint.com/sqlite/sqlite_using_joins.htm

You can use the new Virtual layer feature from QGIS 2.14 to create such a layer on-the-fly without having to store a separate layer. Let us know if you need help on the virtual layer.

Hope this helps,
Andreas
On 01.03.2016 16:58, Thomas Colley wrote:
Hi everyone

I was just looking through the changelogs and got really excited when I saw data defined control over map layers! (http://www.qgis.org/en/site/forusers/visualchangelog212/index.html#feature-data-defined-control-over-map-layers-and-style-presets)

This is exactly what I’d been asking about on the list last year (http://lists.osgeo.org/pipermail/qgis-user/2015-August/033211.html) so thanks so much to Nyall for adding this functionality!

I’m not 100% sure that I’m using it in the correct way though. I have managed to achieve it by duplicating my atlas coverage features so that there is one feature per layer with an attribute holding the layer name. I then use the attribute in the data defined layers option.

Is this the way to do it or am I missing something? I wasn’t sure where/if the ‘set layer list from a visibility preset’ should come into play.

When I first read the post I thought that the | separated list of layers would be cycled through one by one but then realised that they’d all be displayed together.

I have a static list of 20 or so layers to cycle through for each site so ideally if I could specify a list of layers (or visibility presets) to loop through that would be amazing.

Failing that I can write a little plugin to take a selected feature and create a scratch layer with the feature duplicated with the layer attribute values.

Thanks again for adding this, it’ll be a massive time saver for us!

Tom





_______________________________________________

Qgis-user mailing list

Qgis-user at lists.osgeo.org<mailto:Qgis-user at lists.osgeo.org>

List info: http://lists.osgeo.org/mailman/listinfo/qgis-user

Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

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


More information about the Qgis-user mailing list