[Qgis-developer] Fwd: QgsExpression class can't evaluate not registered Layers

Enrico Ferreguti enricofer at gmail.com
Thu Dec 3 05:00:29 PST 2015


Hi Nathan,

you can have a look to a the new version of changeDataSource plugin I was
releasing: https://github.com/enricofer/changeDataSource
Once installed, clicking on toolbutton [image: Immagine incorporata 3] is
possible to change the datasources of loaded layers
Expressions are used to massively replace datasources strings using a dummy
memory layer build up on the fly (called layerTable) that contains loaded
layers parameters.
This layer appears in legend when dialog is shown to allow expression
performing, because if layerTable layer is not charged in Registry its
fields are not listed in Expression Dialog under "Fields and Values"

[image: Immagine incorporata 4]

Expression is evaluated at row 541 in changeDataSource.py

Thanks.


2015-12-03 13:16 GMT+01:00 Nathan Woodrow <madmanwoo at gmail.com>:

> Hi,
>
> Can you paste and example?
>
> On Thu, 3 Dec 2015 10:10 pm Enrico Ferreguti <enricofer at gmail.com> wrote:
>
>> Hi, I noticed that QgsExpression class can't evaluate layers that are not
>> loaded in QgsMapLayerRegistry.
>> This is a bit annoying because expressions could be evaluated against a
>> temporary datasource or external data without necessary show it to the
>> user. (an alternative question could be: Is it possible to hide a legend
>> item?)
>> Should I submit a feature request for this?
>>
>> Regards
>> Enrico Ferreguti.
>> _______________________________________________
>> Qgis-developer mailing list
>> Qgis-developer at lists.osgeo.org
>> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20151203/02e687f6/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: icon.png
Type: image/png
Size: 1433 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20151203/02e687f6/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cds_plugin.png
Type: image/png
Size: 26893 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20151203/02e687f6/attachment-0003.png>


More information about the Qgis-developer mailing list