I want to get x/y coordinates of a point on mouse click for a point and need to use those coordinates to evaluate other values as per other modules already define.
How can I get x/y coordinates on mouse click in QGIS and print those in PyQGIS?
coordinatespointpyqgisqgisxy
I want to get x/y coordinates of a point on mouse click for a point and need to use those coordinates to evaluate other values as per other modules already define.
How can I get x/y coordinates on mouse click in QGIS and print those in PyQGIS?
Best Answer
You need QgsMapToolEmitPoint class to do that. Following code works well for that purpose:
However, if you prefer a class, following code can also be used: