[Qgis-developer] RealTime Data and QGis

Abhay abhay.menon at gmail.com
Sun Apr 12 11:10:23 EDT 2009


On Sat, Apr 11, 2009 at 10:46 AM, Abhay <abhay.menon at gmail.com> wrote:

> Hi all,
> I was reading through some old post and found this
> http://lists.osgeo.org/pipermail/qgis-user/2008-March/002423.html
> even thought the solution is great. But I am still trying to find a
> solution that work in C++ completely.
>
> I was able to manage to plot the data (present point .. in future could be
> also have Polygon and Lines) by placing a blank shapefile with desire data
> structure (created on loading of QGisApp) and loading it to the mapper,
> thereafter plotting the data using the QTimer event.
>
> But the very basic functionality of QGis is not coming up as desire. Like I
> wanted to read the attributes of the realtime data which I had pushed with
> as per the data structure in QGis. I only receive attribute of X and Y back
> from point being plotted. Have anybody device some logic to retrieve the
> same.
>
> A query that come to my mind, is it possible to replace the my input
> shapefile in realtime at the background and the data and attribute updated
> get reflected to the Mapper without enabling the editing options or
> reloading the shapefile.
>
> Any Input or pointers would be appreciated.
>
> Best Regards
>
> Abhay.
>
>
Hello All,

As per the earlier post. I tried out some interim method.
I was able to implement a imperfect solution using 2 method, but both had
problems of there own.

1) I used the technique stated in MapTool to draw my layer on the
QgsMapCanvas to do a partial step.  Also using a base of blank shapefile
(for datastructure/fieldname and attribute) and placing the data in the
Memory to render to QgsVectorLayer using QgsFeature. But this is possible
only when the layer is set to edit mode and also the feature attribute does
not seem to appear on the layer until the toggleEdit if not switched off.

2) Second method I used is push the data to file rather than pushing the to
mapper. then use toggleEdit in between and place operation to select and
remove all the feature using QgsVectorLayer invertSelection and
deleteSelectedFeatures. and do a mapRefresh() to render the new dataset.
Problem from the 1st method is solved and I have feature attribute. But a
new problem arises this method make the mapper flicker each time the new set
of data is pushed periodically.

Is there any better method if any body could suggest or hint, it would be
really helpful.

Does RubberBand support multiple featuretype like point, line and polygon? I
not sure if I can try this step.

Thanks and Rgds.

Abhay.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20090412/0401c92c/attachment.html


More information about the Qgis-developer mailing list