[Qgis-developer] Real-time updates to shapefile in QGIS

Martin Dobias wonder.sk at gmail.com
Wed May 14 16:59:59 EDT 2008


Hi Josh

On Wed, May 14, 2008 at 9:10 PM, Josh Kretzmer <jkretzmer at redzone.com> wrote:
> I am currently attempting to write a Python plugin for QGIS to handle
> updates from a GPS receiver in real-time.  I have a thread that is
> reading / parsing the lat long updates and adding these points to a
> shapefile.  Is there anyway to force an update of the vector layer on
> which these point are rendered each time a new point is added?

you would have to do QgsMapCanvas::refresh() everytime, which means
redrawing also all other layers. It would be better to use a map
canvas item to draw the GPS track so that you could avoid unnecessary
redraws. You can check my simple QGIS-based application to get the
idea:
http://mapserver.sk/~wonder/qnavigator/

Regards
Martin


More information about the Qgis-developer mailing list