3

If I want to create a GDAL PAM statistics file with the command gdalinfo -stats from a GRIB file, e.g. needed for DynamicColorMapping, GDAL only creates the statistics internally inside the sourcefile. Is it possible to force gdalinfo -stats to create the additional file (.aux.xml)?

A way to do this is programmatically with Python and to tinker with the XML, but that doesn't fit my needs.

5

As a workaround you can use command

gdalinfo -stats -hist input.tif

Selecting the histogram option triggers the creation of input.tif.aux.xml file.

1

The following isn't a direct GDAL solution for your question, but it might help. The Orfeo Toolbox command otbcli_ComputeImagesStatistics can be used to generate raster band statistics and output them to an XML file. For instance:

otbcli_ComputeImagesStatistics -il input_image.tif -out output.xml

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.