[Qgis-user] Dynamic Source Filtering in QGIS - How?
DelazJ
delazj at gmail.com
Sat May 3 22:17:47 PDT 2025
Hello,
Stefan, You wrote "display", and while it may be expensive, what about using a symbology, categorized or rule-based, in which your expression will do the job? I didn't look at the exact expression, but it will look for features that intersect the current canvas extent, sort and filter them using the arrays functions. The ones that don't meet the criteria will be applied no symbol.
Regards,
Harrissou
Le 4 mai 2025 00:47:18 GMT+02:00, chris hermansen via QGIS-User <qgis-user at lists.osgeo.org> a écrit :
>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/20250504/cb6188a8/attachment.htm>
More information about the QGIS-User
mailing list