1

I created a plugin in QGIS 2 AND I used the qgis:rasterlayerstatistics , I could get the 'COUNT' information : pixels number, but when I migrate my plugin to version 3.4 I found out that this information (COUNT) is not available anymore .

is there any other way to have raster statistics about pixels number ?

1 Answer 1

2

Use the Raster layer unique values report tool instead. When the interface loads, make sure to create an output for the Unique values table parameter as this would contain the count information:

Raster layer unique values report interface

The output of this table will be an .html file which can be loaded from the Results Viewer (from the menubar: Processing > Results Viewer) and should look something like the following:

Results Viewer

2
  • 1
    thanks, it's working
    – Namoat
    Commented Oct 25, 2019 at 13:18
  • @Namoat - Most welcome, glad it helped :)
    – Joseph
    Commented Oct 25, 2019 at 13:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.