Hi,
I wrote a PYTHON plugin that does a simple feature select on a
QgsVectorLayer:
pnt = <coordinates of mouse click on map >
myLayer= <QgsVectorLayer Object>
tolerance = 1
rectangle = QgsRectangle()
rectangle.setXMinimum (pnt.x() - tolerance)
rectangle.setXMaximum (pnt.x() + tolerance)
rectangle.setYMinimum (pnt.y() - tolerance)
rectangle.setYMaximum (pnt.y() + tolerance)
myLayer.select(rectangle , True)
in QGIS 1.6 this code works with both shapefiles and postgis layers,
in QGIS 1.7 it works ONLY in postgis layers, on shapefile layers it always
returns 0 features.
_______________________________________________
Qgis-developer mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-developer