[gdal-dev] Computing statistics from raster dataset without writing aux.xml
Sean Gillies
sean.gillies at gmail.com
Mon Oct 10 06:42:42 PDT 2022
Hi,
Another approach, also involving a copy, is to read the raster data as
numpy arrays and compute the statistics of those arrays. The GDAL method
also has to read the raster data to compute statistics, of course, but
doesn't store the entirety of it in memory.
On Mon, Oct 10, 2022, 6:51 AM Laurențiu Nicola via gdal-dev <
gdal-dev at lists.osgeo.org> wrote:
> Hi Mats,
>
> This won't help you, but I wanted to suggest you make a temporary
> directory, copy the .aux.xml file there, then set GDAL_PAM_PROXY_DIR.
> Unfortunately, at least in my test, GDAL still seems to save the file next
> to the input, even when calling SetConfigOption before doing anything
> else.
>
> Regards,
> Laurentiu
>
> On Mon, Oct 10, 2022, at 13:11, Budalen, Mats Bruun via gdal-dev wrote:
>
> Hello!
>
>
>
> I’m writing a Python program which reads raster data. The program uses the
> *ComputeStatistics()* 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 *gdal.SetConfigOption('GDAL_PAM_ENABLED','NO')* before I open
> the dataset.
>
>
>
> 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.
>
>
>
> Is there any way to compute statistics without creating/changing the
> aux.xml, while at the same time reading the SRS?
>
>
>
>
>
> Regards,
>
>
>
> Mats Budalen
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20221010/81d763da/attachment.htm>
More information about the gdal-dev
mailing list