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 ?


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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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