<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p>Hi Tom,</p>
<p> </p>
<p>@atlas_feature returns a full feature - with geometry and attributes - similar to a full database record type. With this feature you could extract the geometry and the attributes.</p>
<p>You probably want @atlas_featurenumber and @atlas_totalfeatures ?</p>
<p>@atlas_featureid should return the unique id (primary key) of your feature. I just tested it with a physical table and it worked. If it doesn't work, it may well be a side-effect of using a virtual layer? If this is the case - could you try saving the virtual layer to a physical table?</p>
<p>Greetings,</p>
<p>Andreas</p>
<p>On 2016-03-02 14:33, Thomas Colley wrote:</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0"><!-- html ignored --><!-- head ignored --><!-- meta ignored --><!-- meta ignored -->
<div class="WordSection1">
<p class="MsoNormal"><span style="color: #1f497d;">Hi Andreas<!-- o ignored --></span></p>
<p class="MsoNormal"><span style="color: #1f497d;"><!-- o ignored --> </span></p>
<p class="MsoNormal"><span style="color: #1f497d;">That's excellent, thanks so much, I never thought about joining tables. The virtual layer works really well.<!-- o ignored --></span></p>
<p class="MsoNormal"><span style="color: #1f497d;"><!-- o ignored --> </span></p>
<p class="MsoNormal"><span style="color: #1f497d;">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:<!-- o ignored --></span></p>
<p class="MsoNormal"><span style="color: #1f497d;"><!-- o ignored --> </span></p>
<p class="MsoNormal"><span style="color: #1f497d;">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.<!-- o ignored --></span></p>
<p class="MsoNormal"><span style="color: #1f497d;"><!-- o ignored --> </span></p>
<p class="MsoNormal"><span style="color: #1f497d;">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')).<!-- o ignored --></span></p>
<p class="MsoNormal"><span style="color: #1f497d;"><!-- o ignored --> </span></p>
<p class="MsoNormal" style="text-align: justify;"><span style="color: #1f497d;">Cheers<!-- o ignored --></span></p>
<p class="MsoNormal" style="text-align: justify;"><span style="color: #1f497d;"><br /> Tom<!-- o ignored --></span></p>
<p class="MsoNormal" style="text-align: justify;"><span style="color: #1f497d;"><!-- o ignored --> </span></p>
<div>
<div style="border: none; border-top: solid #B5C4DF 1.0pt; padding: 3.0pt 0cm 0cm 0cm;">
<p class="MsoNormal"><strong><span style="font-size: 10.0pt; font-family: 'Tahoma','sans-serif'; color: windowtext; mso-fareast-language: EN-GB;">From:</span></strong><span style="font-size: 10.0pt; font-family: 'Tahoma','sans-serif'; color: windowtext; mso-fareast-language: EN-GB;"> Qgis-user [mailto:qgis-user-bounces@lists.osgeo.org] <strong>On Behalf Of </strong>Andreas Neumann<br /><strong>Sent:</strong> 01 March 2016 20:12<br /><strong>To:</strong> qgis-user@lists.osgeo.org<br /><strong>Subject:</strong> Re: [Qgis-user] Layer driven Atlas<!-- o ignored --></span></p>
</div>
</div>
<p class="MsoNormal"><!-- o ignored --> </p>
<p class="MsoNormal" style="margin-bottom: 12.0pt;">Hi Thomas,<br /><br /> You will need a table with a record per page for the atlas coverage layer.<br /><br /> 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.<br /><br /> See <a href="http://www.tutorialspoint.com/sqlite/sqlite_using_joins.htm">http://www.tutorialspoint.com/sqlite/sqlite_using_joins.htm</a><br /><br /> 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.<br /><br /> Hope this helps,<br /> Andreas<!-- o ignored --></p>
<div>
<p class="MsoNormal">On 01.03.2016 16:58, Thomas Colley wrote:<!-- o ignored --></p>
</div>
<blockquote style="margin-top: 5.0pt; margin-bottom: 5.0pt;">
<p class="MsoNormal">Hi everyone<!-- o ignored --></p>
<p class="MsoNormal"> <!-- o ignored --></p>
<p class="MsoNormal">I was just looking through the changelogs and got really excited when I saw data defined control over map layers! (<a href="http://www.qgis.org/en/site/forusers/visualchangelog212/index.html#feature-data-defined-control-over-map-layers-and-style-presets">http://www.qgis.org/en/site/forusers/visualchangelog212/index.html#feature-data-defined-control-over-map-layers-and-style-presets</a>)<!-- o ignored --></p>
<p class="MsoNormal"> <!-- o ignored --></p>
<p class="MsoNormal">This is exactly what I'd been asking about on the list last year (<a href="http://lists.osgeo.org/pipermail/qgis-user/2015-August/033211.html">http://lists.osgeo.org/pipermail/qgis-user/2015-August/033211.html</a>) so thanks so much to Nyall for adding this functionality!<!-- o ignored --></p>
<p class="MsoNormal"> <!-- o ignored --></p>
<p class="MsoNormal">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.<!-- o ignored --></p>
<p class="MsoNormal"> <!-- o ignored --></p>
<p class="MsoNormal">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. <!-- o ignored --></p>
<p class="MsoNormal"> <!-- o ignored --></p>
<p class="MsoNormal">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.<!-- o ignored --></p>
<p class="MsoNormal"> <!-- o ignored --></p>
<p class="MsoNormal">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.<!-- o ignored --></p>
<p class="MsoNormal"> <!-- o ignored --></p>
<p class="MsoNormal">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.<!-- o ignored --></p>
<p class="MsoNormal"> <!-- o ignored --></p>
<p class="MsoNormal">Thanks again for adding this, it'll be a massive time saver for us!<!-- o ignored --></p>
<p class="MsoNormal"> <!-- o ignored --></p>
<p class="MsoNormal">Tom<!-- o ignored --></p>
<p class="MsoNormal"> <!-- o ignored --></p>
<p class="MsoNormal"><span style="font-size: 12.0pt; font-family: 'Times New Roman','serif'; mso-fareast-language: EN-GB;"><br /><br /><br /><!-- o ignored --></span></p>
<pre>_______________________________________________<!-- o ignored --></pre>
<pre>Qgis-user mailing list<!-- o ignored --></pre>
<pre><a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><!-- o ignored --></pre>
<pre>List info: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><!-- o ignored --></pre>
<pre>Unsubscribe: <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><!-- o ignored --></pre>
</blockquote>
<p class="MsoNormal"><span style="font-size: 12.0pt; font-family: 'Times New Roman','serif'; mso-fareast-language: EN-GB;"><!-- o ignored --> </span></p>
</div>
</blockquote>
<p> </p>
<div> </div>
</body></html>