[Qgis-user] troubles with QGis Atlas

didier peeters dpeeter1 at ulb.ac.be
Tue Jan 12 07:08:56 PST 2016


Thank you very much, Nyall, your solution works perfectly !
Didier

> Le 12 janv. 2016 à 11:35, Nyall Dawson <nyall.dawson at gmail.com> a écrit :
> 
> On 12 January 2016 at 12:01, Nyall Dawson <nyall.dawson at gmail.com> wrote:
>> 
>> On 12 Jan 2016 8:36 AM, "didier peeters" <dpeeter1 at ulb.ac.be> wrote:
>>> 
>>> Thank you Nyall.
>>> 
>>> Oh, this could be the reason.  To clarify a little bit, my field is not
>>> called « id » and my coverage layer is a Postgis table, the field I use has
>>> a PK and the geometry layer is a Postgis view with numerical values that I
>>> represent with proportional circles.
>>> Does it mean that what I want to do is not possible ?  Or should I use
>>> another data source ?
>> 
>> It should be possible. Can you share a few rows from both tables?
>> 
> 
> (sharing the solution with the list)
> 
> After looking at your data, the ID field in your database is a string.
> Feature IDs in QGIS are always numeric, so QGIS generates it's own
> feature ID and can't reuse the database's primary key.
> 
> The solution is to update your expression. Instead of "id_field" =
> @atlas_featureid'
> 
> Use
> 
> "id_field"  = attribute( @atlas_feature,'id_field' )
> 
> Nyall
> 
> 
> 
>> Nyall
>> 
>>> 
>>> Didier
>>> 
>>> 
>>>> Le 11 janv. 2016 à 21:26, Nyall Dawson <nyall.dawson at gmail.com> a écrit
>>>> :
>>>> 
>>>> On 12 January 2016 at 02:18, didier peeters <dpeeter1 at ulb.ac.be> wrote:
>>>>> Hello,
>>>>> 
>>>>> I’ve started to use the Atlas in QGis composer: I use a non-geometry
>>>>> table
>>>>> as coverage layer, providing the feature id’s and corresponding labels
>>>>> for
>>>>> my maps, and I display always the same extent but with different data
>>>>> of
>>>>> course, using a rule-based style like ‘ "field" = @atlas_featureid'.
>>>>> At
>>>>> first it worked fine but now, the atlas mistakes @atlas_featurenumber
>>>>> for
>>>>> @atlas_featureid, i.e. instead of displaying the data corresponding to
>>>>> the
>>>>> feature id it displays the data corresponding to the number of the
>>>>> feature
>>>>> (~ the row number, as some are filtered out), but selects properly the
>>>>> labels corresponding to the feature value.  So I obtain maps with a
>>>>> title
>>>>> which is not related to the content !
>>>>> In the expression editor @atlas_featureid and @atlas_featurenumber are
>>>>> previewed with the same Current value although they are different !
>>>>> 
>>>>> Does anyone have an idea about this ?
>>>> 
>>>> Keep in mind that feature id's might not be predictable, depending on
>>>> your data source. They aren't user visible, and as such aren't
>>>> suitable for a join like this.
>>>> 
>>>> Did you mean instead to use a field called "id" from your coverage
>>>> layer?
>>>> 
>>>> Nyall
>>>> 
>>>>> 
>>>>> I use QGis 2.12.1 on Mac.
>>>>> 
>>>>> Didier
>>>>> 
>>>>> _______________________________________________
>>>>> Qgis-user mailing list
>>>>> 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
>>> 
>>> _______________________________________________
>>> Qgis-user mailing list
>>> 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




More information about the Qgis-user mailing list