Friday, 12 June 2015

visibility - Figuring out whether a feature is visible or not in pyqgis


I have a vector layer (lines) with a numeric (integer) attribute, let's call it Status. This layer is styled according to the attribute using a categorized style:



Categorized style


So far, so good. Now I'm trying to figure out a way to get the visibility status (i.e., I click the checkbox on the left) of a feature in this layer using pyqgis. Here's what I have so far:




  • It's possible to get the individual QgsRendererCategoryV2 instances by using layer.rendererV2().categories(). This categories, however, don't seem to contain the visibility information, but only the values and colors (or I'm missing something).




  • The individiual symbols (e.g. with layer.rendererV2().symbols()) don't help me either.





Ideally I would like a solution like feature.isCurrentlyVisible(), but I'm prepared to having to look up the attribute in the table myself.




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...