2

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?

3

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.

  • 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. Jun 18 '15 at 11:13
  • 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 Jun 18 '15 at 19:02
  • 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. Jun 22 '15 at 7:00

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.