[Qgis-developer] How to get feat.geometry() from SpatiaLite in pyQGis ?
geodrinx at gmail.com
Fri Dec 6 01:23:52 PST 2013
Hi Christos (!),
sorry but your code works only in QGis 1.8 version.
I am using the 2.0.1 version and pyQGis methods are changed:
BTW, my problem is:
- using a SHP file layer, elements are returned
- using SpatiaLite layer, elements are returned, but each is empty.
It 'a known issue?
Someone in the list has tried it?
2013/12/6 mmekuria <sailmcm at yahoo.com>
> Hi, Roberto:
> I think the query from layer.getFeatures() returns an iterator and that
> means you use the nextFeature(feat) to get the next feature until it fails
> to return a feature, then it means you have reached the end of the iterator
> iter = layer.getFeatures()
> while iter.nextFeature(feat):
> geom = feat.geometry()
> elem = geom.asPolyline()
> print("ELEM %s\n") %(elem)
> for p1 in elem:
> x1,y1 = p1.x(),p1.y()
> print("XY= %lf %lf\n") %(x1, y1)
> Should work for you,
> Maaza Christos, PhD
> View this message in context:
> Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Qgis-developer