[Qgis-developer] implement data provider in python?

Alister Hood Alister.Hood at synergine.com
Wed Aug 29 16:34:57 PDT 2012


Hi,
Didn't someone say they were working on an on-the-fly graticule provider, which is similar to your use case (but I doubt it involved Python)?

Alister


> Date: Wed, 29 Aug 2012 16:53:39 +0200
> From: "G. Allegri" <giohappy at gmail.com>
> To: Etienne Tourigny <etourigny.dev at gmail.com>
> Cc: qgis-developer <qgis-developer at lists.osgeo.org>
> Subject: Re: [Qgis-developer] implement data provider in python?
> Message-ID:
> 	<CAB4g1=yvywN4zBoQYevNeyVDV=mOUEGOYV1GEO7XhiVna3p_Jg at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> Thanks Etienne, I didn't know it.
> 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.
> 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.
> 
> giovanni
> 
> 2012/8/29 Etienne Tourigny <etourigny.dev at gmail.com>
> 
> > I am not quite sure how it works, and there are few details available,
> > maybe someone who knows how it works can provide some insight?
> >
> > The openlayer plugin is implemented as a plugin layer. It doesn't
> > interact with other layers, but seems to do what you are talking about
> > (gets queried on every pan/zoom/etc to retrieve the update data).
> > Have a look at the code.
> >
> > API stuff:
> > http://qgis.org/api/classQgsPluginLayer.html
> > http://hub.qgis.org/issues/2392
> >
> > On Wed, Aug 29, 2012 at 11:04 AM, G. Allegri <giohappy at gmail.com> wrote:
> > >> you might be able to achieve that using "plugin layers" which are
> > >> map layers that can be created and updated by plugins
> > >
> > >
> > > What do you mean Etienne?
> > > How can I serve a layer, dynamically, through a python plugin? I
> > > don't
> > want
> > > to have a plugin that creates a memory layer, but that gets queried
> > > on
> > every
> > > pan/zoom/etc to retrieve the update data.
> > >
> > > giovanni
> > >
> > >>
> > >>
> > >> > The other is having the possibility to bridge, easily, any kind
> > >> > of
> > data
> > >> > source, using python as an adapter.
> > >> >
> > >> > giovanni
> > >> >
> > >> >
> > >> >
> > >> >
> > >> > 2012/8/29 Barry Rowlingson <b.rowlingson at lancaster.ac.uk>
> > >> >>
> > >> >> I have a vague memory that the python data provider idea was
> > >> >> considered a while ago. I was thinking about how one could get
> > >> >> direct access from Qgis to R spatial data sets stored in R's
> binary files.
> > >> >> One method would have been to write a provider in python that
> > >> >> used
> > Rpy
> > >> >> to bridge to R, but wasn't possible because you can't write data
> > >> >> providers in Python. It could be done in C by linking to R's C
> > >> >> library, but at that point I lost interest and used a looser
> > >> >> coupling to get my R data into Qgis.
> > >> >>
> > >> >> The argument then went that if the provider was designed to
> > >> >> access a file it would be a better idea to write a GDAL/OGR
> > >> >> driver, then even people outside QGIS could use it. Obviously
> > >> >> that would have to be C/C++ though.
> > >> >>
> > >> >> And then I think everyone got bored and went back to doing things.
> > >> >>
> > >> >> Do you have a specific use-case?
> > >> >>
> > >> >> On Wed, Aug 29, 2012 at 8:01 AM, G. Allegri <giohappy at gmail.com>
> > wrote:
> > >> >> > Anybody interested in developing the concept and evaluating
> > >> >> > its feasibility?
> > >> >> > I'm considering the possibility to sponsor it.
> > >> >> >
> > >> >> > giovanni
> > >> >> >
> > >> >> > Sent from Nexus
> > >> >> >
> > >> >> > Il giorno 28/ago/2012 00:11, "G. Allegri" <giohappy at gmail.com>
> > >> >> > ha
> > >> >> > scritto:
> > >> >> >>
> > >> >> >> AFAIK it isn't possible to register a python script as a
> > >> >> >> dataprovider.
> > >> >> >> Maybe it sounds odd, but I think it would interesting if we
> > >> >> >> could have it.
> > >> >> >> Has it been ever considered? How hard would it be to implement
> it?
> > >> >> >>
> > >> >> >> Giovanni
> > >> >> >>
> > >> >> >> Sent from Nexus
> > >> >
> > >> >
> > >> >
> > >> > _______________________________________________
> > >> > Qgis-developer mailing list
> > >> > Qgis-developer at lists.osgeo.org
> > >> > http://lists.osgeo.org/mailman/listinfo/qgis-developer
> > >> >
> > >
> > >
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.osgeo.org/pipermail/qgis-
> developer/attachments/20120829/14b512b8/attachment.html>
> 
> ------------------------------
> 
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
> 
> 
> End of Qgis-developer Digest, Vol 82, Issue 88
> **********************************************


More information about the Qgis-developer mailing list