I have a list of addresses in one layer and a polygon layer of census block groups for the local town, all stored in postgis. I have a nice display right now that labels each polygon with a count of houses within that block group by creating a postgis view along the lines of:
create view block_groups_count as select g.id, count(1) from block_groups g join addresses a on st_covers(g.geom, a.geom) group by g.id;I can join this with the polygon layer itself and get the labeling Iwant. This works great with respect to modifying the polygon layer: Ican make changes, click "save", and everything updates automatically.
But now that I've got this far, I am looking for a mechanism by whichI can get the labels in the polygon layer to update dynamically inreaction to changes to qgis filters applied to the address layer.
That is, if I apply a "show only blue houses" filter to the list ofaddresses, I want to counts to reflect only the number of blue houseswithin in each polygon.
Is it possible to set up this sort of behavior with qgis?
One alternative I've considered is to simply to create a new countview for each attribute, but this results in several additionallayers, and switching between different views isn't particularlygraceful.
أكثر...
create view block_groups_count as select g.id, count(1) from block_groups g join addresses a on st_covers(g.geom, a.geom) group by g.id;I can join this with the polygon layer itself and get the labeling Iwant. This works great with respect to modifying the polygon layer: Ican make changes, click "save", and everything updates automatically.
But now that I've got this far, I am looking for a mechanism by whichI can get the labels in the polygon layer to update dynamically inreaction to changes to qgis filters applied to the address layer.
That is, if I apply a "show only blue houses" filter to the list ofaddresses, I want to counts to reflect only the number of blue houseswithin in each polygon.
Is it possible to set up this sort of behavior with qgis?
One alternative I've considered is to simply to create a new countview for each attribute, but this results in several additionallayers, and switching between different views isn't particularlygraceful.
أكثر...