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

2019-11-11 Thread Tim Sutton
Hi



> On 12 Nov 2019, at 08:10, Alexander Bruy  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  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  to 
make finding time easy.

___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

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

2019-11-11 Thread Alexander Bruy
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.

вт, 12 лист. 2019 о 08:59 Tim Sutton  пише:

> Hi
>
> On 12 Nov 2019, at 07:52, Alexander Bruy  wrote:
>
> Hi Tim,
>
> if I understand you correctly, this already implemented. When you edit an
> expression
> in the modeler algorithm all model inputs are available as variables in
> the expression
> editor.
>
>
> Thanks for your reply Alexander. I should have clarified that I already
> tried to find the inputs in the expression editor and couldn’t. Could you
> clarify which expression group it should be listed in? This is what I get
> at the moment:
>
>
> I thought I would find it in ‘Fields and Values’ but that group has only
> one entry:  NULL
>
> I also tried searching on one of the input value’s names but the result
> was empty.
>
> Thanks!
>
> Regards
>
> Tim
>
> —
>
>
>
>
>
>
>
>
> *Tim Sutton*
>
> *Co-founder:* Kartoza
> *Ex Project chair:* QGIS.org
>
> Visit 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
>  to make finding time easy.
>
>

-- 
Alexander Bruy
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

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

2019-11-11 Thread Tim Sutton
Hi

> On 12 Nov 2019, at 07:52, Alexander Bruy  wrote:
> 
> Hi Tim,
> 
> if I understand you correctly, this already implemented. When you edit an 
> expression
> in the modeler algorithm all model inputs are available as variables in the 
> expression
> editor.

Thanks for your reply Alexander. I should have clarified that I already tried 
to find the inputs in the expression editor and couldn’t. Could you clarify 
which expression group it should be listed in? This is what I get at the moment:



I thought I would find it in ‘Fields and Values’ but that group has only one 
entry:  NULL

I also tried searching on one of the input value’s names but the result was 
empty.

Thanks!

Regards

Tim

—









Tim Sutton

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

Visit 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  to 
make finding time easy.

___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

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

2019-11-11 Thread Alexander Bruy
Hi Tim,

if I understand you correctly, this already implemented. When you edit an
expression
in the modeler algorithm all model inputs are available as variables in the
expression
editor.

пн, 11 лист. 2019 о 16:17 Tim Sutton  пише:

> Hi All
>
> I am trying to automate some tedious tasks of remapping fkey references
> for tables in a GeoPackage database from the related table’s id column to
> the related table’s uuid column.
>
> I can do the process manually by opening the table, using field calculator
> and creating a new column ‘water_source_uuid’ with an expression like this:
>
> attribute(
>get_feature( 'water_source_lookup', 'id', water_source_id), 'uuid’)
>
>
> Now being a lazy bugger, I thought I would try to automate the process for
> the other columns and tables that need such treatment.
>
>
>
>
>
> NowI thought I could write a little expression that pulls out the name of
> the layer defined by the user in “Data Table” and the name of the column
> defined by the user in  "Foreign Key Column” and then interpolate those
> values into my add column expression….
>
> So my question is: is there any way to reference other inputs in a model
> from an expression?
>
> Regards
>
> Tim
>
>
>
>
>
>
>
>
> —
>
>
>
>
>
>
>
>
>
>
> *Tim Sutton*
>
> *Co-founder:* Kartoza
> *Ex Project chair:* QGIS.org
>
> Visit 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
>  to make finding time easy.
>
> ___
> QGIS-Developer mailing list
> QGIS-Developer@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer



-- 
Alexander Bruy
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer