-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathSkipTrackTool.py
More file actions
86 lines (64 loc) · 2.19 KB
/
Copy pathSkipTrackTool.py
File metadata and controls
86 lines (64 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# -*- coding: utf-8 -*-
'''
Video Uav Tracker v 2.0
Replay a video in sync with a gps track displayed on the map.
-------------------
copyright : (C) 2017 by Salvatore Agosta
email : sagost@katamail.com
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
INSTRUCTION:
Syncing:
- Create new project
- Select video and .gpx track (1 trkpt per second)
- Identify first couple Frame/GpsTime and select it.
- Push Synchronize
- Push Start
Replay:
- Move on map
- Create associated DB shapefile
- Add POI with associated video frame saved
- Extract frames with associated coordinates for rapid photogrammetry use
'''
from qgis.gui import QgsMapTool
from PyQt5.QtGui import QCursor
from PyQt5.QtCore import Qt
class SkipTrackTool(QgsMapTool):
def __init__(self, canvas, layer,Parent):
QgsMapTool.__init__(self,canvas)
self.Parent = Parent
self.canvas=canvas
self.layer = layer
self.geom = None
self.rb = None
self.x0 = None
self.y0 = None
#our own fancy cursor
self.cursor = QCursor(Qt.CrossCursor)
def canvasPressEvent(self,event):
layer = self.layer
x = event.pos().x()
y = event.pos().y()
point = self.toLayerCoordinates(layer,event.pos())
pointMap = self.toMapCoordinates(layer, point)
self.x0 = point.x()
self.y0 = point.y()
self.Parent.findNearestPointInRecording(self.x0,self.y0)
def canvasMoveEvent(self,event):
pass
def canvasReleaseEvent(self,event):
pass
def showSettingsWarning(self):
pass
def activate(self):
self.canvas.setCursor(self.cursor)
def deactivate(self):
pass
def isZoomTool(self):
return False
def isTransient(self):
return False
def isEditTool(self):
return True