<div dir="ltr"><div><div>Hi Christos (!),<br><br><br></div>sorry but your code works only in QGis 1.8 version.<br></div>I am using the 2.0.1 version and pyQGis methods are changed:<br><div><div><br><a href="http://hub.qgis.org/wiki/quantum-gis/Python_plugin_API_changes_from_18_to_20" target="_blank">http://hub.qgis.org/wiki/quantum-gis/Python_plugin_API_changes_from_18_to_20</a> <br>

<br></div><div><br></div><div>BTW, my problem is:  <br><br>- using a SHP file layer,  elements are returned<br></div><div>- using SpatiaLite layer,  elements are returned, but each is empty.<br><br></div><div><br></div><div>

<span id="result_box" class="" lang="en"><span class="">It</span> <span class="">'</span><span>a known issue</span><span>?</span><br><span class="">Someone in the list</span> <span class="">has</span> <span class="">tried it?</span></span></div>
<div><br><br></div><div>Roberto<br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/12/6 mmekuria <span dir="ltr"><<a href="mailto:sailmcm@yahoo.com" target="_blank">sailmcm@yahoo.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi, Roberto:<br>
<br>
I think the query from layer.getFeatures() returns an iterator and that<br>
means you use the nextFeature(feat) to get the next feature until it fails<br>
to return a feature, then it means you have reached the end of the iterator<br>
list.<br>
<br>
iter = layer.getFeatures()<br>
while iter.nextFeature(feat):<br>
<div class="im">    geom = feat.geometry()<br>
    elem = geom.asPolyline()<br>
    print("ELEM %s\n") %(elem)<br>
    for p1 in elem:<br>
        x1,y1 = p1.x(),p1.y()<br>
        print("XY= %lf %lf\n") %(x1, y1)<br>
<br>
<br>
</div>Should work for you,<br>
<br>
<br>
<br>
<br>
<br>
-----<br>
Maaza Christos, PhD<br>
<a href="http://www.Axumcorp.com" target="_blank">www.Axumcorp.com</a><br>
<br>
--<br>
View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/How-to-get-feat-geometry-from-SpatiaLite-in-pyQGis-tp5092891p5093041.html" target="_blank">http://osgeo-org.1560.x6.nabble.com/How-to-get-feat-geometry-from-SpatiaLite-in-pyQGis-tp5092891p5093041.html</a><br>

Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</blockquote></div><br></div>