[Qgis-developer] Problem with intersects function on windows only
bertGIS
bidou_smithers at hotmail.com
Thu Aug 30 05:28:28 PDT 2012
Hello,
I use this code for selecting features, for selecting a feature and get its
parameters in a form.
It works well on Ubuntu, but when moving to Windows 7 with QGIS 1.7.4 or
QGIS 1.8,
the selection does not work, seems to be the intersect function that returns
no geometry.
Does anybody knows something about that ?
Thanks for your help
Cheers,
Bert
def selectFeature(self, point, button):
self.selectList = []
QMessageBox.information( self.iface.mainWindow(),"Info", "in
selectFeature function" )
pntGeom = QgsGeometry.fromPoint(point)
pntBuff = pntGeom.buffer( (self.canvas.mapUnitsPerPixel() * 2),0)
rect = pntBuff.boundingBox()
if self.cLayer:
feat = QgsFeature()
self.provider.select([],rect)
while self.provider.nextFeature(feat):
QMessageBox.information( self.iface.mainWindow(),"Info", "loop on
features" )
if feat.geometry().intersects(pntGeom):
QMessageBox.information( self.iface.mainWindow(),"Info", "feature"
+ str(feat.id()) + " inter")
self.selectList.append(feat.id())
if self.selectList:
self.cLayer.setSelectedFeatures(self.selectList)
self.updateForm()
else:
QMessageBox.information( self.iface.mainWindow(),"Info", "No layer
currently selected in TOC" )
--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Problem-with-intersects-function-on-windows-only-tp4998864.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
More information about the Qgis-developer
mailing list