I am currently involved in a student project which is to turn string GPS coordinates into a GPS tracker. This is my current work: First, the UDP data is shared through a LAN (No internet available) therefore, I get it with an UDP socket. The frame: (DDS coordinates)
"lat+4542000lon-00019590alt+658"
Then I translate it in DD coordinates so that I can show it on the map using this code:
plane=QgsVertexMarker(canvas)
plane.setColor(QColor("blue"))
plane.setIconSize(10)
plane.setIconType(QgsVertexMarker.ICON_CROSS)
plane.setPenWidth(3)
plane.setCenter(QgsPoint(lon,lat))
plane.show()
With 1 mark it works very well. But I receive new frame every second and I'd like to move this mark simultaneously. That's why I tried this:
#I assumed that the first point is already shown
while n<3600:
data,addr=sock.recvfrom(1024)
lat,lon,alt=prepare(data)
plane.hide()
plane.setCenter(QgsPoint(lon,lat))
plane.show()
n+=1
But when I run this, Qgis is frozen until the last mark appears while I expect to see one mark after another and to run QGIS normally. How can I fix it? --QGIS 2.14, Python 2.7, Windows 7 32bits, no internet--