[Qgis-developer] How to get feat.geometry() from SpatiaLite in pyQGis ?

2013-12-05 Thread Geo DrinX
Hello all,


as in object, within pyQGis  I need to read the geometry of a SpatiaLite
vector layer.

This is my source code:

layer = iface.mapCanvas().currentLayer()
iter = layer.getFeatures()
for feat in iter:
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)


But... it returns only:

ELEM []
ELEM []
ELEM []
ELEM []

etcetera, instead of something like this :

ELEM [(2.37786e+06,4.60302e+06), (2.37784e+06,4.60304e+06)]

... that I had with a normal qgis layer.

Sure, I miss something.

Somebody can help me to understand how to get geometry from SpatiaLite ?


Thank you in advance

Roberto
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [Qgis-developer] How to get feat.geometry() from SpatiaLite in pyQGis ?

2013-12-05 Thread mmekuria
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
list.

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
www.Axumcorp.com

--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/How-to-get-feat-geometry-from-SpatiaLite-in-pyQGis-tp5092891p5093041.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


[Qgis-developer] C++ Plugins failing due to upgrade (missing what procedue)?

2013-12-05 Thread mmekuria
I am getting this error message with my C++ plugins and am wondering why? Can
anyone help solve this puzzle? Is there any documentation that tells what
has changed as far as plugins written in C++ for QGIS 2.0 to install them?
It seems to me that there may be a procedure that it is lookign for in the
plugin that used to install in the past. I see several other plugins also
fail due to the same error message. I see what Nathan was saying that C++
plugins are getting by the way side due to lack of maintenance. But I am
tryign to maintain and I need information to do it.

Below is the message I get for several plugins including my own,

Failed to load C:/Program Files/qgis2.1.0/plugins/sqlanywhereprovider.dll
(Reason: Cannot load library C:/Program
Files/qgis2.1.0/plugins/sqlanywhereprovider.dll: The specified procedure
could not be found.)

Thank you,

Maaza



-
Maaza Christos, PhD
www.Axumcorp.com

--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/C-Plugins-failing-due-to-upgrade-missing-what-procedue-tp5093042.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] layer order

2013-12-05 Thread mmekuria
Open the project file and look for the list of layers. I think the order is
based on how it is stored in the project file. Something must be happening
while saving the project.   



-
Maaza Christos, PhD
www.Axumcorp.com

--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/layer-order-tp5092676p5093044.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer