<!DOCTYPE html><html><head><title></title><style type="text/css">#qt p.qt-MsoNormal{margin-top:0cm;margin-right:0cm;margin-bottom:0cm;margin-left:0cm;font-size:11pt;font-family:"Calibri", sans-serif;}

p.MsoNormal,p.MsoNoSpacing{margin:0}</style></head><body><div style="font-family:Arial;">Hi Mats,<br></div><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">This won't help you, but I wanted to suggest you make a temporary directory, copy the .aux.xml file there, then set <span class="font" style="font-family:menlo, consolas, monospace, sans-serif;">GDAL_PAM_PROXY_DIR</span>. Unfortunately, at least in my test, GDAL still seems to save the file next to the input, even when calling <span class="font" style="font-family:menlo, consolas, monospace, sans-serif;">SetConfigOption</span> before doing anything else.<br></div><div style="font-family:Arial;"><br></div><div style="font-family:Arial;">Regards,<br></div><div style="font-family:Arial;">Laurentiu<br></div><div style="font-family:Arial;"><br></div><div>On Mon, Oct 10, 2022, at 13:11, Budalen, Mats Bruun via gdal-dev wrote:<br></div><blockquote type="cite" id="qt" style="overflow-wrap:break-word;"><div class="qt-WordSection1"><p class="qt-MsoNormal"><span lang="EN-GB">Hello!</span><br></p><p class="qt-MsoNormal"><span lang="EN-GB"> </span><br></p><p class="qt-MsoNormal"><span lang="EN-GB">I’m writing a Python program which reads raster data. The program uses the <b>ComputeStatistics()</b> function on the dataset, which automatically attempts to write the result to an .aux.xml next to the raster file. I do not under any circumstance want to try to write to the source directory, so I have set <b>gdal.SetConfigOption('GDAL_PAM_ENABLED','NO')</b> before I open the dataset.</span><br></p><p class="qt-MsoNormal"><span lang="EN-GB"> </span><br></p><p class="qt-MsoNormal"><span lang="EN-GB">My program will sometimes come across datasets where the SRS is only defined in an aux.xml. Unfortunately, the above ConfigOption prevents the SRS definition from being read from the aux.xml.</span><br></p><p class="qt-MsoNormal"><span lang="EN-GB"> </span><br></p><p class="qt-MsoNormal"><span lang="EN-GB">Is there any way to compute statistics without creating/changing the aux.xml, while at the same time reading the SRS?</span><br></p><p class="qt-MsoNormal"><span lang="EN-GB"> </span><br></p><p class="qt-MsoNormal"><span lang="EN-GB"> </span><br></p><p class="qt-MsoNormal"><span lang="EN-GB">Regards,</span><br></p><p class="qt-MsoNormal"><span lang="EN-GB"> </span><br></p><p class="qt-MsoNormal"><span lang="EN-GB">Mats Budalen</span><br></p></div><div>_______________________________________________<br></div><div>gdal-dev mailing list<br></div><div><a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br></div><div><a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br></div><div><br></div></blockquote><div style="font-family:Arial;"><br></div></body></html>