Geographic Information Systems Asked by mefistotelis on July 1, 2021
I need a way to quickly copy coordinates under mouse to paste them to external program (3D reconstruction software I use for making maps from photos).
I see the coordinates within status bar at bottom of the screen; my hack of getting what I want right now is to:
So this works, but is a bit annoying. Is there a better way?
When I try to google this, I’m getting articles on "Coordinate Capture" Plugin. But it doesn’t seem to be present in current versions of QGIS.
Previously in QGIS it was possible by means of the "Coordinate Capture" Plugin (firstly it was a Plugin, then it became a Core Plugin). There are some threads on this particular topic: Coordinate Capture in QGIS 3.0 and How to turn the QGIS "Coordinate capture" plugin on?.
Nowadays the functionality of this Plugin has been added as a map toolkit in QGIS 3.14, see this issue on the GitHub for more details.
So, simply RMC the map canvas > Copy Coordinate...
, see the image below
and get a pair of your coordinates as 9.115780774,48.813284425
.
Correct answer by Taras on July 1, 2021
If you need to transform the coordinates (like swapping X and Y, using a specific CRS, using a specific format etc), or if you need to capture an extent, you can use the lat lon tools
plugin.
Once the tool is selected, each time you (left) click on the map the mouse coordinates is copied to the clipboard.
Answered by JGH on July 1, 2021
Use this script in QGIS Python Editor. It copies the coordinates under the cursor to clipboard, then you can paste them to other application.
class CopyCoordinatesTool(QgsMapTool):
def __init__(self, iface):
QgsMapTool.__init__(self, iface.mapCanvas())
self.canvas = iface.mapCanvas()
def activate(self):
self.canvas.setCursor(Qt.ArrowCursor)
def canvasMoveEvent(self, e):
crs = self.canvas.mapSettings().destinationCrs()
x = e.pos().x()
y = e.pos().y()
p = self.canvas.getCoordinateTransform().toMapCoordinates(x, y)
c = QApplication.clipboard()
c.setText(f"{p.x()}, {p.y()}n")
map_tool = CopyCoordinatesTool(iface)
iface.mapCanvas().setMapTool(map_tool)
Demo:
Answered by Kadir Şahbaz on July 1, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP