[QGIS-Developer] Inserting provider filter just before PostGIS layer is loaded?

Carlo A. Bertelli (Charta s.r.l.) carlo.bertelli at gmail.com
Mon Aug 22 05:36:06 PDT 2022


I think this could find an interesting framework in the proposal of a new
database interface. One of the proposals pertains to the process interface.
Maybe it could become a more generic interface to data sources. More and
more data infrastructures are intrinsically no-SQL and it could be
interesting to mix them at the source level and not afterwards when it
becomes heavy and very application specific.
Disclaimer: I had a love affair with MapInfo MapBasic and I miss its
command interface. It would be wonderful to have a SQL-like interface for
it – and the Spatialite interface that comes with GDAL would be a good
opportunity for it.
BTW: maybe a virtual GDAL interface would help in getting what you need for
OsGeo services.


On Mon, Aug 22, 2022 at 12:11 PM Jacky Volpes via QGIS-Developer <
qgis-developer at lists.osgeo.org> wrote:

> Hi,
>
> I don't know any way to do this, except for using a workaround.
> But it will depend on your use-case.
> Maybe using query layers, such as
>
> QgsVectorLayer("table='(select * from <schema>.<table> <your conditions>)'
> service='<service>' key='<unique id column>'", "<table name>", "postgres")
>
> can help ?
>
> Regards,
> Jacky
>
>
>
> Le 09/08/2022 à 11:15, Johannes Kröger (WhereGroup) via QGIS-Developer a
> écrit :
>
> Howdy!
>
> I'd like to force a provider filter when a user adds a PostGIS layer and
> have it applied *before* any data is loaded. Setting it after the layer
> (and some of its big data) is loaded initially is not an option.
>
> Is there a way to sneak in between "user clicked something in the GUI to
> load a table/query and QGIS will construct a QgsVectorLayer now" and "QGIS
> now talks to the PostGIS database to get the data for the new layer", maybe
> with a signal?
>
> Something like a "layerAboutToBeLoaded" (like the opposite
> layerWillBeRemoved on https://qgis.org/pyqgis/master/core/QgsProject.html)
> basically. :o)
>
> Cheers, Hannes
>
>
> _______________________________________________
> QGIS-Developer mailing listQGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
> --
> Jacky Volpes
>
> Ingénieur SIG - Oslandia
>
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20220822/ae10ac70/attachment.htm>


More information about the QGIS-Developer mailing list