<div dir="ltr"><div>Hi,</div><div><br></div><div>Thanks Nyall. If it uses the same getFeatures method 
 (already shown multiple times)

then I'll remove that example.</div><div><br></div><div>Regards,</div><div>Harrissou<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">Le ven. 14 sept. 2018 à 01:59, Nyall Dawson <<a href="mailto:nyall.dawson@gmail.com">nyall.dawson@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, 13 Sep 2018 at 15:40, DelazJ <<a href="mailto:delazj@gmail.com" target="_blank">delazj@gmail.com</a>> wrote:<br>
><br>
> Hi,<br>
> CCing to qgis-dev as nobody in community seems... inspired by the question and I'd like to close that old PR and rebase other changes.<br>
><br>
> Thanks for any hint.<br>
><br>
> Harrissou<br>
><br>
> Le mar. 11 sept. 2018 à 18:12, DelazJ <<a href="mailto:delazj@gmail.com" target="_blank">delazj@gmail.com</a>> a écrit :<br>
>><br>
>> Hi all,<br>
>><br>
>> QGIS documentation states [0] that Processing can be used to iterate over features with the following code:<br>
>><br>
>> import processing<br>
>> features = processing.features(layer)<br>
>> for feature in features:<br>
>>     # do whatever you need with the feature<br>
>><br>
>> This code no longer works in QGIS3 and needs an update [1] I fail to find.<br>
>> So anyone to suggest the right replacement, please?<br>
<br>
Just iterate directly over the features from the source. The things<br>
which processing.features used to do is taken care of transparently<br>
for you now.<br>
<br>
I.e.<br>
<br>
    source = self.parameterAsSource(parameters, 'INPUT', context)<br>
    for f in source.getFeatures():<br>
       # do something with f<br>
<br>
As much as possible, Processing-specific methods were removed in QGIS<br>
3.0 in favour of the standard PyQGIS calls. This was done to reduce<br>
code duplication, and make the API more consistent (i.e. easier to<br>
move code between Processing algorithms -> standalone scripts/plugins<br>
and vice versa).<br>
<br>
Nyall<br>
</blockquote></div>