5

i need to calculate raster statistics for RGBN (4 channels, multiband image) rasters in QGIS.

In Arcgis if you use "calculate statistics" in ArcCatalog, statistics are calculated for every image band.

In Qgis if you use "Raster layer statistics" you get a log file with a summary of image stats, so you cannot extract statistics for each band.

Do you know how this is achieved in Qgis?

1 Answer 1

6

One way to get statistics for each band in QGIS raster layer is:

  1. Go to Raster menu
  2. Expand the Miscellaneus list and select Information... tool
  3. In new window select your raster layer
  4. Activate command edditing with a Pencil icon
  5. Add -stats flag to a command (between gdalinfo and path to raster)

enter image description here

Run a command.

As a result you will see log with simple statistics for each band.

3
  • 1
    i worked out the issue with gdal tool and the flag -stats as you said. The problem is that i have a lot of images and i need to report the stats of each image and each band. The batch process of gdalinfo do have report export to xml but does not have a command editor. Do u know a way to batch the gdalinfo tool with the command editor in order to get a xml report file?
    – Harris P.
    Commented Jun 18, 2015 at 11:13
  • 1
    This can be done by creating batch script. Run a FOR loop and call gdalinfo -stats %%G for each image, saving an output to a file. If U're not familiar with scripting I can help U. Just give me more details: are all your images stored in one dir or in subdirs, do you want single report file or a report file for each image, what system you're working on. At the end I think you should edit your question - to keep GIS.SE clean.
    – jzol
    Commented Jun 18, 2015 at 19:02
  • 1
    i am not familiar with scripting. Yes all the images are in the same folder. Is it possibly to get a single report for all files and for each image? I am working on win7. I didn't understand your comment about editing my question.
    – Harris P.
    Commented Jun 22, 2015 at 7:00

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.