[Qgis-developer] Python Snapping
Maurício de Paulo
mauricio.dev at gmail.com
Thu Nov 12 11:06:23 EST 2009
I've been working on the QgsAzimuth plugin and recently some users told me
of a limitation on the code I wrote.
The snapping is not with enough precision.
The following code is the event that I wrote that tries to use snap and if
not possible, use the captured pixel as coordinate. Is it the right way of
implementing a snap tool?
#transforming pixels to x,y
transform = self.canvas.getCoordinateTransform()
xy = transform.toMapCoordinates(pixels) #captures the clicked
coordinate and transform
self.emit(SIGNAL("finished(PyQt_PyObject)"),xy) #return QgsPoint in
Thanks in advance.
Mauricio de Paulo
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Qgis-developer