[Qgis-user] Dynamic Source Filtering in QGIS - How?
chris hermansen
clhermansen at gmail.com
Sat May 3 15:47:18 PDT 2025
Stefan and list,
On Sat, May 3, 2025, 11:53 Stefan Keller via QGIS-User <
qgis-user at lists.osgeo.org> wrote:
> Dear all,
>
> I would like to display only say the 50 most important features of a
> layer in a QGIS project when I zoom out and in. Almost all features
> have an attribute qrank starting at NULL or 1, and the larger qrank
> is, the more "important" the object is. Here is a demo of the web app
> https://castle-map.infs.ch/
>
> You can set a filter by right-clicking on the layer, e.g. as follows:
> SELECT * FROM “castles_etc_ranked_osm_2025” ORDER BY qrank DESC LIMIT 50;
>
> The problem is that QGIS only applies this filter (and SQL) once (when
> setting up the filter). However, I want QGIS to update this filter and
> reapply it every time someone's zooming or panning.
>
> I have looked in vain at the options for “Update Layer with notify” in
> the layer menu in the “Display” tab. I also tried it with a view and
> the file manager, but without success.
>
> 1. Can QGIS be configured this way? E.g. with Dynamic Provider Filter
> Plugin?
> 2. I think a small Python script (QGIS Python Console) could be
> another solutions. But which signals would I need to intercept?
>
> Yours, Stefan
>
What if you turn off the cache? So that the query has to be re-evaluated on
each draw?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20250503/49431579/attachment.htm>
More information about the QGIS-User
mailing list