Thanks Etienne, I didn't know it.<div>Yet it doesn't do exactly what I was thinking about, beacuse I suppose that the plugin layer cannot be managed as a true layer. AFAICS it has to implement the rendering operations, which set the style, etc.</div>
<div>Having a "plugin provider" would require only to write the code to provide the data, leaving the rest of the management (styling, rendering, etc.) to Qgis.</div><div><br></div><div>giovanni<br><br><div class="gmail_quote">
2012/8/29 Etienne Tourigny <span dir="ltr"><<a href="mailto:etourigny.dev@gmail.com" target="_blank">etourigny.dev@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I am not quite sure how it works, and there are few details available,<br>
maybe someone who knows how it works can provide some insight?<br>
<br>
The openlayer plugin is implemented as a plugin layer. It doesn't<br>
interact with other layers, but seems to do what you are talking about<br>
(gets queried on every pan/zoom/etc to retrieve the update data).<br>
Have a look at the code.<br>
<br>
API stuff:<br>
<a href="http://qgis.org/api/classQgsPluginLayer.html" target="_blank">http://qgis.org/api/classQgsPluginLayer.html</a><br>
<a href="http://hub.qgis.org/issues/2392" target="_blank">http://hub.qgis.org/issues/2392</a><br>
<div class="HOEnZb"><div class="h5"><br>
On Wed, Aug 29, 2012 at 11:04 AM, G. Allegri <<a href="mailto:giohappy@gmail.com">giohappy@gmail.com</a>> wrote:<br>
>> you might be able to achieve that using "plugin layers" which are map<br>
>> layers that can be created and updated by plugins<br>
><br>
><br>
> What do you mean Etienne?<br>
> How can I serve a layer, dynamically, through a python plugin? I don't want<br>
> to have a plugin that creates a memory layer, but that gets queried on every<br>
> pan/zoom/etc to retrieve the update data.<br>
><br>
> giovanni<br>
><br>
>><br>
>><br>
>> > The other is having the possibility to bridge, easily, any kind of data<br>
>> > source, using python as an adapter.<br>
>> ><br>
>> > giovanni<br>
>> ><br>
>> ><br>
>> ><br>
>> ><br>
>> > 2012/8/29 Barry Rowlingson <<a href="mailto:b.rowlingson@lancaster.ac.uk">b.rowlingson@lancaster.ac.uk</a>><br>
>> >><br>
>> >> I have a vague memory that the python data provider idea was<br>
>> >> considered a while ago. I was thinking about how one could get direct<br>
>> >> access from Qgis to R spatial data sets stored in R's binary files.<br>
>> >> One method would have been to write a provider in python that used Rpy<br>
>> >> to bridge to R, but wasn't possible because you can't write data<br>
>> >> providers in Python. It could be done in C by linking to R's C<br>
>> >> library, but at that point I lost interest and used a looser coupling<br>
>> >> to get my R data into Qgis.<br>
>> >><br>
>> >> The argument then went that if the provider was designed to access a<br>
>> >> file it would be a better idea to write a GDAL/OGR driver, then even<br>
>> >> people outside QGIS could use it. Obviously that would have to be<br>
>> >> C/C++ though.<br>
>> >><br>
>> >> And then I think everyone got bored and went back to doing things.<br>
>> >><br>
>> >> Do you have a specific use-case?<br>
>> >><br>
>> >> On Wed, Aug 29, 2012 at 8:01 AM, G. Allegri <<a href="mailto:giohappy@gmail.com">giohappy@gmail.com</a>> wrote:<br>
>> >> > Anybody interested in developing the concept and evaluating its<br>
>> >> > feasibility?<br>
>> >> > I'm considering the possibility to sponsor it.<br>
>> >> ><br>
>> >> > giovanni<br>
>> >> ><br>
>> >> > Sent from Nexus<br>
>> >> ><br>
>> >> > Il giorno 28/ago/2012 00:11, "G. Allegri" <<a href="mailto:giohappy@gmail.com">giohappy@gmail.com</a>> ha<br>
>> >> > scritto:<br>
>> >> >><br>
>> >> >> AFAIK it isn't possible to register a python script as a<br>
>> >> >> dataprovider.<br>
>> >> >> Maybe it sounds odd, but I think it would interesting if we could<br>
>> >> >> have<br>
>> >> >> it.<br>
>> >> >> Has it been ever considered? How hard would it be to implement it?<br>
>> >> >><br>
>> >> >> Giovanni<br>
>> >> >><br>
>> >> >> Sent from Nexus<br>
>> ><br>
>> ><br>
>> ><br>
>> > _______________________________________________<br>
>> > Qgis-developer mailing list<br>
>> > <a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
>> > <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
>> ><br>
><br>
><br>
</div></div></blockquote></div><br></div>