[QGIS-Developer] Getting the values of other algorithms and parameters in processing's modeller

Tim Sutton tim at kartoza.com
Mon Nov 11 23:35:53 PST 2019


Hi



> On 12 Nov 2019, at 08:10, Alexander Bruy <alexander.bruy at gmail.com> wrote:
> 
> Hi Tim,
> 
> if I'm not mistaken, these inputs only available inside expression editor when
> it opened from a modeler algorithm. And they are added as top-level items,
> and don't belong to any group.


Ah thanks you are right! Adding the Field Calculator algorithm for example lets me see it:





But I got other issues now:


I can’t get my expression to validate:


attribute(
get_feature(  @datatable , 'id',  @foreignkeycolumn), 'uuid’)


It validates when I substitute @datatable instead of a hard coded string, but not when I substitute @foreignkeycolumn instead of a hard coded string.


Trying to run it anyway (unsurprisingly) gives:

QGIS version: 3.10.0-A Coruña
QGIS code revision: 6c816b4204
Qt version: 5.12.3
GDAL version: 2.4.1
GEOS version: 3.7.2-CAPI-1.11.2 b55d2125
PROJ version: Rel. 5.2.0, September 15th, 2018
Processing algorithm…
Algorithm 'Convert Lookup To UUID' starting…
Input parameters:
{ 'datatable' : '/Users/timlinux/gisdata/MaceiraMergin/Maceira/smallholding.gpkg|layername=structures', 'foreignkeycolumn' : 'wall_type_id', 'lookuptable' : '/Users/timlinux/gisdata/MaceiraMergin/Maceira/smallholding.gpkg|layername=wall_type' }

Prepare algorithm: qgis:fieldcalculator_1
Running Field calculator [1/1]
Input Parameters:
{ FIELD_LENGTH: 99, FIELD_NAME: '_uuid', FIELD_PRECISION: 3, FIELD_TYPE: 2, FORMULA: 'attribute(\nget_feature( @datatable , \'id\', @foreignkeycolumn), \'uuid’)', INPUT: '/Users/timlinux/gisdata/MaceiraMergin/Maceira/smallholding.gpkg|layername=structures', NEW_FIELD: True, OUTPUT: 'memory:Calculated' }
No root node! Parsing failed?
No root node! Parsing failed?
No root node! Parsing failed?
No root node! Parsing failed?
No root node! Parsing failed?
No root node! Parsing failed?
No root node! Parsing failed?
No root node! Parsing failed?
No root node! Parsing failed?
No root node! Parsing failed?
No root node! Parsing failed?
No root node! Parsing failed?
No root node! Parsing failed?
No root node! Parsing failed?
No root node! Parsing failed?
OK. Execution took 0.413 s (1 outputs).
Model processed OK. Executed 1 algorithms total in 0.514 s.
Execution completed in 0.58 seconds
Results:
{}

Loading resulting layers
Algorithm 'Convert Lookup To UUID’ finished


Regards

Tim
—









Tim Sutton

Co-founder: Kartoza
Ex Project chair: QGIS.org

Visit http://kartoza.com <http://kartoza.com/> to find out about open source:

Desktop GIS programming services
Geospatial web development
GIS Training
Consulting Services

Skype: timlinux 
IRC: timlinux on #qgis at freenode.net

I'd love to connect. Here's my calendar link <https://calendly.com/timlinux> to make finding time easy.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20191112/fd79f7e6/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot 2019-11-12 at 08.21.35.jpg
Type: image/jpeg
Size: 41444 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20191112/fd79f7e6/attachment-0002.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: KartozaNewLogoThumbnail.jpg
Type: image/jpeg
Size: 6122 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20191112/fd79f7e6/attachment-0003.jpg>


More information about the QGIS-Developer mailing list