I am doing a lot of image tile processing and ultimately need to generate some very large rasters (for example 300k x 400k pixels). These might be mosaiced from 1000+ individual tiles. If I calculate pyramids and statistics using gdaladdo and gdal_edit, QGIS can read it right in. However, if I load that TIFF into ArcGIS Pro, I'll wait about 18-24 hours for the statistics to calculate. On Windows I have this running from a generated batch script.
with open('teststats.bat', 'w') as mybat:
mybat.write(r'gdaladdo --config USE_RRD YES --config GDAL_NUM_THREADS 20 {0} '.format(outFile) +'\n')
mybat.write(r'gdal_edit.py -stats {0}'.format(outFile) +'\n')
mybat.write(r'gdalinfo {0} -stats --config GDAL_PAM_ENABLED TRUE'.format(outFileIMG) +'\n')
subprocess.call([r'teststats.bat'])
I found on this question How to get GDAL to create statistics for GTiff in Python that adding the GDAL_PAM_ENABLED flag would generate a similar stats xml to what arc generates. That is now creating the xml but arc still immediately starts calculating stats. I know some will say, "Just read it in QGIS" but that won't work for my business environment.