Select to view content in your preferred language

Is there a statistics-cache for rasters?

550
2
Jump to solution
10-09-2024 04:40 AM
nadja
by
Frequent Contributor

We've got some COG Tif on a server online and add them as VRT to ArcGIS Pro using gdal functions. I don't have writing rights on that server via its url, only reading rights. Some of the there stored rasters don't have statistics. In that case I can add the rasters without statistics - in this case the metadata of the vrt never hold the statistics (as expected). However if I add the raster and let it calculate the statistics, the next  time adding the same data to a *NEW* project, the statistics of the same raster somehow exist - even though the COG Tif on server has none and I don't have writing rights on the server. Thus I think the statistics are also stored in a cache. Does anyone know, whether the statiics are stored in a cache? if yes, where do I find that cache? if no, how else could this behaviour be explained?

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
Luke_Pinner
MVP Regular Contributor

GDAL can write an .aux.xml locally when accessing files from a location where the user does not have write permissions.  This auxillary metadata contains the cached stats.

This location is controlled by an environment variable or GDAL config option "GDAL_PAM_PROXY_DIR"

I don't know if this actually is the way your statistics are being cached as ArcGIS may have it's own cache mechanism. Nor do I know if there's a default location in the ArcGIS environment . I can't check as I don't have ArcGIS access as I'm on leave from work currently. 

One way to check would be to see if ArcGIS sets a  GDAL_PAM_PROXY_DIR  env dir (or set the env var  GDAL_PAM_PROXY_DIR yourself to a known directory before opening ArcGIS), then look for .aux.xml in there after calculating statistics.

View solution in original post

0 Kudos
2 Replies
Luke_Pinner
MVP Regular Contributor

GDAL can write an .aux.xml locally when accessing files from a location where the user does not have write permissions.  This auxillary metadata contains the cached stats.

This location is controlled by an environment variable or GDAL config option "GDAL_PAM_PROXY_DIR"

I don't know if this actually is the way your statistics are being cached as ArcGIS may have it's own cache mechanism. Nor do I know if there's a default location in the ArcGIS environment . I can't check as I don't have ArcGIS access as I'm on leave from work currently. 

One way to check would be to see if ArcGIS sets a  GDAL_PAM_PROXY_DIR  env dir (or set the env var  GDAL_PAM_PROXY_DIR yourself to a known directory before opening ArcGIS), then look for .aux.xml in there after calculating statistics.

0 Kudos
nadja
by
Frequent Contributor

thanks Luke, I ended up using 

gdal.SetConfigOption('GDAL_PAM_ENABLED', 'NO') 

which stopped the aux.xml files from being created. 

0 Kudos