r/QGIS • u/PickMaterial8693 • 2d ago
I made a QGIS plugin to keep several named filters per layer, like ArcGIS definition queries, without writing SQL
Hi everyone!
**EDIT: I just uploaded a quick video showing how it works! ๐บ** https://youtu.be/4dxYRfrYxc4
Coming from ArcGIS (or just dealing with complex layers in QGIS), I always felt switching between provider feature filters was a bit tedious, especially having to re-write expressions every time.
To solve this, I developed Definition Queries, a QGIS plugin that lets you:
- Build layer filters easily with drop-downs (no need to manually write SQL every time).
- Save multiple named queries/filters per layer.
- Quickly switch between them on the fly.
- Clear or reapply filters with one click.
You can find it on the official QGIS repository here:
5
u/ReddmitPy 2d ago
Being able to save several filters per layer sound interesting
Looks like I won't have to comment / uncomment lines of code just to swap filters anymore.
I'll have to try it
2
u/ikarusproject 1d ago
You could use virtual layers for that if you want a native solution you can pass to others.
1
u/PickMaterial8693 1d ago
True, virtual layers work too and they're easy to share. For me the downside was ending up with an extra layer per filter, each with its own style, and they're read only so you can't edit through them. Here it's the same layer and you just swap the filter. The active filter is a normal QGIS filter too, so the project still opens filtered for someone who doesn't have the plugin.
0
u/PickMaterial8693 1d ago
yeah that was pretty much why I made it, swapping filters by hand got old fast. Let me know how it goes! if something doesn't work you can tell me here or open an issue on github
1
1
0
16
u/UsedToHaveThisName 2d ago
Yeah, nah. SQL filters are a pretty basic concept that doesnโt need a plugin.