<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: times new roman,new york,times,serif; font-size: 12pt; color: #000000'><span style="background-color: rgb(255, 255, 255);">Hi list,</span><div style="background-color: rgb(255, 255, 255);">I use an iterator two times in a python code and I have to reset it to the starting point before to recall it.</div><div style="background-color: rgb(255, 255, 255);"><br></div><div style="background-color: rgb(255, 255, 255);"># first use of the iterator</div><div style="background-color: rgb(255, 255, 255);">iterator = layer.dataProvider().getFeatures()   </div><div style="background-color: rgb(255, 255, 255);"></div><div style="background-color: rgb(255, 255, 255);">for feature in iterator:</div><div style="background-color: rgb(255, 255, 255);"><span class="Apple-tab-span" style="white-space: pre;">     </span>#  operations</div><div style="background-color: rgb(255, 255, 255);"></div><div style="background-color: rgb(255, 255, 255);"># than, a second time I have to use the operator, in a following part of the code:</div><div style="background-color: rgb(255, 255, 255);"><div>for feature in iterator:</div><div><span class="Apple-tab-span" style="white-space: pre;">       </span>#  other operations</div></div><div style="background-color: rgb(255, 255, 255);"><br></div><div style="background-color: rgb(255, 255, 255);">But it doesn't start from the first feature!</div><div style="background-color: rgb(255, 255, 255);"></div><div style="background-color: rgb(255, 255, 255);"><br></div><div style="background-color: rgb(255, 255, 255);">I try with:</div><div style="background-color: rgb(255, 255, 255);">iterator.rewind()</div><div style="background-color: rgb(255, 255, 255);"><span style="font-size: 12pt;">between the two blocks, </span>but it doesn't work.</div><div style="background-color: rgb(255, 255, 255);"><br></div><div style="background-color: rgb(255, 255, 255);">Thanks.</div><div style="background-color: rgb(255, 255, 255);"></div><div style="background-color: rgb(255, 255, 255);"></div><div style="background-color: rgb(255, 255, 255);"></div><div style="background-color: rgb(255, 255, 255);"><br><div>Stefano Masera</div></div><br></div></body></html>