Re: [QGIS-Developer] Python QgsProcessingLagorithm.parameterAsSink return values

2018-02-14 Thread G. Allegri
Ok, thanks.

2018-02-14 15:41 GMT+01:00 Salvatore Larosa :

> Sorry...
>
> http://python.qgis.org/api/
>
> On Wed, Feb 14, 2018 at 3:40 PM, G. Allegri  wrote:
>
>> That's what I thought Salvatore, but I can only see the text "QGIS Python
>> Documentation" on a blank page.
>> I guess it's currently broken...
>>
>> 2018-02-14 15:38 GMT+01:00 Salvatore Larosa :
>>
>>> On Wed, Feb 14, 2018 at 3:33 PM, G. Allegri  wrote:
>>>
 Thanks Nyall and Salvatore.
 I missed the SIP_OUT specifier of the destinationIdentifier parameter.

 Some days ago I saw the PyQGIS API docs from a link by Nyall, but I
 can't find it now. Where are they?

>>>
>>> http://python.qgis.org
>>>
>>> Ciao.
>>>
>>>
>>> --
>>> Salvatore Larosa
>>> linkedIn: http://linkedin.com/in/larosasalvatore
>>> twitter: @lrssvt
>>> skype: s.larosa
>>> IRC: lrssvt on freenode
>>>
>>
>>
>
>
> --
> Salvatore Larosa
> linkedIn: http://linkedin.com/in/larosasalvatore
> twitter: @lrssvt
> skype: s.larosa
> IRC: lrssvt on freenode
>
___
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] Python QgsProcessingLagorithm.parameterAsSink return values

2018-02-14 Thread Salvatore Larosa
Sorry...

http://python.qgis.org/api/

On Wed, Feb 14, 2018 at 3:40 PM, G. Allegri  wrote:

> That's what I thought Salvatore, but I can only see the text "QGIS Python
> Documentation" on a blank page.
> I guess it's currently broken...
>
> 2018-02-14 15:38 GMT+01:00 Salvatore Larosa :
>
>> On Wed, Feb 14, 2018 at 3:33 PM, G. Allegri  wrote:
>>
>>> Thanks Nyall and Salvatore.
>>> I missed the SIP_OUT specifier of the destinationIdentifier parameter.
>>>
>>> Some days ago I saw the PyQGIS API docs from a link by Nyall, but I
>>> can't find it now. Where are they?
>>>
>>
>> http://python.qgis.org
>>
>> Ciao.
>>
>>
>> --
>> Salvatore Larosa
>> linkedIn: http://linkedin.com/in/larosasalvatore
>> twitter: @lrssvt
>> skype: s.larosa
>> IRC: lrssvt on freenode
>>
>
>


-- 
Salvatore Larosa
linkedIn: http://linkedin.com/in/larosasalvatore
twitter: @lrssvt
skype: s.larosa
IRC: lrssvt on freenode
___
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] Python QgsProcessingLagorithm.parameterAsSink return values

2018-02-14 Thread G. Allegri
That's what I thought Salvatore, but I can only see the text "QGIS Python
Documentation" on a blank page.
I guess it's currently broken...

2018-02-14 15:38 GMT+01:00 Salvatore Larosa :

> On Wed, Feb 14, 2018 at 3:33 PM, G. Allegri  wrote:
>
>> Thanks Nyall and Salvatore.
>> I missed the SIP_OUT specifier of the destinationIdentifier parameter.
>>
>> Some days ago I saw the PyQGIS API docs from a link by Nyall, but I can't
>> find it now. Where are they?
>>
>
> http://python.qgis.org
>
> Ciao.
>
>
> --
> Salvatore Larosa
> linkedIn: http://linkedin.com/in/larosasalvatore
> twitter: @lrssvt
> skype: s.larosa
> IRC: lrssvt on freenode
>
___
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] Python QgsProcessingLagorithm.parameterAsSink return values

2018-02-14 Thread Salvatore Larosa
On Wed, Feb 14, 2018 at 3:33 PM, G. Allegri  wrote:

> Thanks Nyall and Salvatore.
> I missed the SIP_OUT specifier of the destinationIdentifier parameter.
>
> Some days ago I saw the PyQGIS API docs from a link by Nyall, but I can't
> find it now. Where are they?
>

http://python.qgis.org

Ciao.


-- 
Salvatore Larosa
linkedIn: http://linkedin.com/in/larosasalvatore
twitter: @lrssvt
skype: s.larosa
IRC: lrssvt on freenode
___
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] Python QgsProcessingLagorithm.parameterAsSink return values

2018-02-14 Thread G. Allegri
Thanks Nyall and Salvatore.
I missed the SIP_OUT specifier of the destinationIdentifier parameter.

Some days ago I saw the PyQGIS API docs from a link by Nyall, but I can't
find it now. Where are they?

Giovanni

2018-02-14 15:13 GMT+01:00 Salvatore Larosa :

> Hi Giovanni,
>
> On Wed, Feb 14, 2018 at 2:13 PM, G. Allegri  wrote:
>
>> I'm trying to follow the code that produces the two return values from
>> QgsProcessingLagorithm.parameterAsSink in Python. I can't find where the
>> sip interface (or whatever) changes the API return value
>> 
>> to the two returned values "sink" and "dest_id".
>>
>> Where does it happen?
>>
>
> it happens here: https://github.com/qgis/QGIS/blob/master/src/core/
> processing/qgsprocessingalgorithm.h#L593
>
>
>> What does the second parameter (destination id) refer to?
>>
>
> the destinationIdentifier string namely the map layer id:
> https://github.com/qgis/QGIS/blob/master/src/core/processing/
> qgsprocessingalgorithm.h#L588
>
> --
> Salvatore Larosa
> linkedIn: http://linkedin.com/in/larosasalvatore
> twitter: @lrssvt
> skype: s.larosa
> IRC: lrssvt on freenode
>
___
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] Python QgsProcessingLagorithm.parameterAsSink return values

2018-02-14 Thread Salvatore Larosa
Hi Giovanni,

On Wed, Feb 14, 2018 at 2:13 PM, G. Allegri  wrote:

> I'm trying to follow the code that produces the two return values from
> QgsProcessingLagorithm.parameterAsSink in Python. I can't find where the
> sip interface (or whatever) changes the API return value
> 
> to the two returned values "sink" and "dest_id".
>
> Where does it happen?
>

it happens here:
https://github.com/qgis/QGIS/blob/master/src/core/processing/qgsprocessingalgorithm.h#L593


> What does the second parameter (destination id) refer to?
>

the destinationIdentifier string namely the map layer id:
https://github.com/qgis/QGIS/blob/master/src/core/processing/qgsprocessingalgorithm.h#L588

-- 
Salvatore Larosa
linkedIn: http://linkedin.com/in/larosasalvatore
twitter: @lrssvt
skype: s.larosa
IRC: lrssvt on freenode
___
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] Python QgsProcessingLagorithm.parameterAsSink return values

2018-02-14 Thread Nyall Dawson
On 15 February 2018 at 00:13, G. Allegri  wrote:
> I'm trying to follow the code that produces the two return values from
> QgsProcessingLagorithm.parameterAsSink in Python. I can't find where the sip
> interface (or whatever) changes the API return value to the two returned
> values "sink" and "dest_id".
>
> Where does it happen?

This is the "destinationIdentifier" argument from the c++ API - sip
automatically converts arguments passed by reference like this into
return values. The PyQGIS docs show it a bit clearer.

> What does the second parameter (destination id) refer to?

Per the docs: "The destinationIdentifier argument will be set to a
string which can be used to retrieve the layer corresponding to the
sink,". It's a unique text identifier which processing uses to later
retrieve the result (and to pass on to following algorithms in a
model). The important thing here is that when your algorithm returns
its result dictionary, it should contain an entry for the output with
the corresponding destinationIdentifier as the value.

Here's a good example:

making the sink:
https://github.com/qgis/QGIS/blob/master/python/plugins/processing/algs/qgis/CheckValidity.py#L126

including it in the results:
https://github.com/qgis/QGIS/blob/master/python/plugins/processing/algs/qgis/CheckValidity.py#L196

Nyall

>
> Thanks,
> Giovanni
>
>
>
> ___
> 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
___
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

[QGIS-Developer] Python QgsProcessingLagorithm.parameterAsSink return values

2018-02-14 Thread G. Allegri
I'm trying to follow the code that produces the two return values from
QgsProcessingLagorithm.parameterAsSink in Python. I can't find where the
sip interface (or whatever) changes the API return value

to the two returned values "sink" and "dest_id".

Where does it happen?
What does the second parameter (destination id) refer to?

Thanks,
Giovanni
___
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