[Qgis-user] automatic refreshing qgis maps

Giuseppe Sucameli brush.tyler at gmail.com
Thu May 27 04:09:42 PDT 2010


Hi Didier,

On Thu, May 27, 2010 at 10:41 AM, Didier Genier <didier.genier at gmail.com>wrote:

> I have a need for a gps-tracking application. With a static position of map
> I want refresh one ore more vector layers (points) to follow vehicles. Data
> side the work is allready made with a PostGis database and Talend ETL to
> write every 15' seconds a view with the last position of tracked vehicles.
> But, in QGis I must refresh manually to see the latest positions.
>
> I have tested to write something like iface.mapCanvas().refresh() with
> python, it's work but my without automation.
>

You can use console to do this:

>>> from PyQt4.QtCore import *

>>> timer = QTimer()

>>> timer.setInterval(15000)
>>> QObject.connect(timer, SIGNAL("timeout()"),
qgis.utils.iface.mapCanvas().refresh)
>>> timer.start()

you can stop it simply typing:
>>> timer.stop()

- Is somebody able to help me for writing a plugin fo doing this ?
>

You can use the code above to create a plugin, by connecting timer.start and

timer.stop to a checkbox or buttons

- Is something already existing to do this ?

- Is this need enough interessant for developpers for a wish to the next
> version ?
>

I think could be interessant, but I don't know if something already exists.

Cheers.

-- 
Giuseppe Sucameli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20100527/2de13bc8/attachment.html>


More information about the Qgis-user mailing list