I'm writing a plugin in QGIS3 which produces a vector file from a thresholded raster (i.e. polygons all have a value of 1 or 0). So far so good. I'd now like to load it in QGIS and display the results so that the 1 values in the vector are displayed (as a filled color) and the 0 values aren't displayed at all. This should just be a display of a categorized vector but I can't figure out the best approach in QGIS3.
Can anyone point me in the right direction, please? I don't have any code to share on this point. I got as far as
processing.run("gdal:polygonize", {'INPUT': self.threshold_raster_obj, 'BAND':1, 'FIELD':'DN','EIGHT_CONNECTEDNESS':False,'OUTPUT': self.out_vectorFilename})
current_layer = self.iface.addVectorLayer(self.out_vectorFilename, "Polygonize_result", "ogr")
i.e. I can polygonize my raster, save it and load it into the main window but I've no idea where to start with the display options. I've looked at some of the examples but I've not been able to understand the right approach for polygons. Unfortunately some things are not intuitive for novices like myself.