<div dir="ltr"><div>Hi,</div><div>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.</div><div><br></div><div>Thanks for any hint.</div><div><br></div><div>Harrissou<br></div><br><div class="gmail_quote"><div dir="ltr">Le mar. 11 sept. 2018 à 18:12, DelazJ <<a href="mailto:delazj@gmail.com">delazj@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"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hi all,</div><div><br></div><div>QGIS documentation states [0] that Processing can be used to iterate over features with the following code:<br><pre><span class="m_-8621827984208480108gmail-m_-3563130988150975156m_-7843572235211416589gmail-kn">import</span> <span class="m_-8621827984208480108gmail-m_-3563130988150975156m_-7843572235211416589gmail-nn">processing</span>
<span class="m_-8621827984208480108gmail-m_-3563130988150975156m_-7843572235211416589gmail-n">features</span> <span class="m_-8621827984208480108gmail-m_-3563130988150975156m_-7843572235211416589gmail-o">=</span> <span class="m_-8621827984208480108gmail-m_-3563130988150975156m_-7843572235211416589gmail-n">processing</span><span class="m_-8621827984208480108gmail-m_-3563130988150975156m_-7843572235211416589gmail-o">.</span><span class="m_-8621827984208480108gmail-m_-3563130988150975156m_-7843572235211416589gmail-n">features</span><span class="m_-8621827984208480108gmail-m_-3563130988150975156m_-7843572235211416589gmail-p">(</span><span class="m_-8621827984208480108gmail-m_-3563130988150975156m_-7843572235211416589gmail-n">layer</span><span class="m_-8621827984208480108gmail-m_-3563130988150975156m_-7843572235211416589gmail-p">)</span>
<span class="m_-8621827984208480108gmail-m_-3563130988150975156m_-7843572235211416589gmail-k">for</span> <span class="m_-8621827984208480108gmail-m_-3563130988150975156m_-7843572235211416589gmail-n">feature</span> <span class="m_-8621827984208480108gmail-m_-3563130988150975156m_-7843572235211416589gmail-ow">in</span> <span class="m_-8621827984208480108gmail-m_-3563130988150975156m_-7843572235211416589gmail-n">features</span><span class="m_-8621827984208480108gmail-m_-3563130988150975156m_-7843572235211416589gmail-p">:</span>
<span class="m_-8621827984208480108gmail-m_-3563130988150975156m_-7843572235211416589gmail-c1"># do whatever you need with the feature<br><br></span></pre><pre><span class="m_-8621827984208480108gmail-m_-3563130988150975156m_-7843572235211416589gmail-c1">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></span></pre><pre><span class="m_-8621827984208480108gmail-m_-3563130988150975156m_-7843572235211416589gmail-c1"></span></pre><pre><span class="m_-8621827984208480108gmail-m_-3563130988150975156m_-7843572235211416589gmail-c1"><br>[0] <a href="https://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/vector.html#iterating-over-selected-features" target="_blank">https://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/vector.html#iterating-over-selected-features</a><br><span class="m_-8621827984208480108gmail-m_-3563130988150975156m_-7843572235211416589gmail-c1">[1] <a href="https://github.com/qgis/QGIS-Documentation/pull/2871" target="_blank">https://github.com/qgis/QGIS-Documentation/pull/2871</a><br></span></span></pre><pre><span class="m_-8621827984208480108gmail-m_-3563130988150975156m_-7843572235211416589gmail-c1">Thanks,<br></span></pre><pre><span class="m_-8621827984208480108gmail-m_-3563130988150975156m_-7843572235211416589gmail-c1">Harrissou<br></span></pre></div></div></div></div>
</blockquote></div></div>