[Qgis-developer] Plotting Moving Points on a map

Martin Dobias wonder.sk at gmail.com
Sun Jun 14 06:35:58 EDT 2009

On Thu, Jun 11, 2009 at 12:41 PM, Luca Pascale<pascale.luca.it at gmail.com> wrote:
> [...]
> After that I want to wait 1 second (for example) and replot the same Feature
> on an update coordinate (x1,y1)= (x,y+something).
> I have tried vl.changeGeometry(.....) but don't works. Any suggestions ?

That's because you would have to put the layer into editing mode. When
in editing mode it gathers all changes to internal buffer and finally
allows to do a commit (store data permanently in data provider) or do
a rollback (forget all changes). You could avoid this by calling
directly provider's changeGeometryValues() function.

For displaying data with regular updates I would suggest you to draw
the points as map canvas items: the main advantage is that the
background map doesn't have to be rendered every second, only the
points are changed.

> Moreover I need that only the Point Vector Layer being refreshed and not
> also the underlying map. Otherway while refresh has done I'll see a white
> screen without any map.

As already written above, map canvas items is the way to go. Try
exploring the QgsVertexMarker class, it might be useful for you.


More information about the Qgis-developer mailing list