[Qgis-developer] PyQGIS script - asPoint() always returning "(0, 0)"

adr.andre at laposte.net adr.andre at laposte.net
Tue Apr 14 12:25:14 PDT 2015


Dear list, 

here is my PyQGIS script: 

##Points=vector 
layer_point = processing.getObject(Points) 

iter = layer_point.getFeatures() 
for point in iter: 
print "Feature ID %d: " % point.id() 

geom = point.geometry() 
if geom.type() == QGis.Point: 
x = geom.asPoint() 
print " Point: " + str(x) 


It always returns " Point: (0,0)" for each geometry 
despite layer_point .extent().toString() returns: 
"402100.4306666287011467,429938.4182564518414438 : 402469.0222782648634166,430309.6282568128081039" 


Would you know how i can debug this? 


Thank you in advance. 


Regards, 

Adrien 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150414/9ad582eb/attachment.html>


More information about the Qgis-developer mailing list