I am working on a project to identify weeds. I used the grid to separate the area. Each cell is marked weed or no weed. I would like to get the GPS of the center of each cell with a weed in it. Does anyone have any idea how to do this? We ultimately hope to upload the coordinates to a drone and have it spray each marked grid.
Hope this helps:
prj = QgsProject.instance() dest_crs= QgsCoordinateReferenceSystem("EPSG:4326")#WGS84 src_crs= prj.crs() transformation = QgsCoordinateTransform(src_crs, dest_crs, prj) yourPoint = QgsPoint(QgsPoint(994369,515288))#example coords yourPoint.transform(transformation) print(yourPoint.x(), "/", yourPoint.y())
will return 21.3538857925002 / 48.260682704154206