I have some vector layers for a whole country stored in a PostGIS database. I want to use that data in different QGIS projects that stand for different regions of the country. In the regional QGIS projects I want to spatially filter the vector-layers to the specific regions.
In other words: different projects should use different filters but the same data source.
I used a spatial SQL Query in QGIS, but the problem is I can't edit that filtered layer anymore (blue dots), the edit button is greyed out.
This is the SQL query I used:
select d.*
from db_betriebsstellen as d
join bundeslaender as b
on ST_WITHIN(d.geom, b.geom) where b.name = ‘Bayern’
I remember using a spatial filter toolbar in Geomedia in the past. The specific spatial filter preference was saved in the Geoworkspace (.gws) which is in Geomedia the same thing like the Project in QGIS (.qgz).
Now I would like to have a similar functionality in QGIS / PostGIS. Any ideas on how to achieve that? Maybe a plugin?
ST_WITHIN(geom, (SELECT geom FROM bundeslaender WHERE name = 'Bayern')
as filter condition, does that work?)
. TryST_WITHIN(geom, (SELECT geom FROM bundeslaender WHERE name = 'Bayern'))
.