[gdal-dev] GDALDataset - not writing to aux.xml?

Michael Dillon mdillon at i3.com
Mon Aug 17 12:11:29 EDT 2009


I'm using the csharp swig wrappers to get information from various types 
of imagery.  I'm relying on the data to be stored in the *.aux.xml file 
for later retrieval. 

For NITF imagery, this seems to work fine.  For GeoTiffs however, none 
of the file's metadata is stored when I call FlushCache() on the 
dataset.  The information is there when I iterate over the various 
metadata domains, but it's not saved.  Another oddity is that histogram 
data *is* written, but no stats or other information.

Am I missing something? (a code snippet is below)

Thanks,

Mike

  private void ProcessMetadataDomain(Dataset ds, string domain)
  {
   string[] metadata = ds.GetMetadata(domain);
   if ((metadata != null) && (metadata.Length > 0))
   {
    ds.FlushCache(); // This isn't [always] writing the contents to the 
aux.xml...?
    WriteLine("  " + domain + " Metadata");
    for (int iMeta = 0; iMeta < metadata.Length; iMeta++)
     WriteLine("    " + iMeta + ":  " + metadata[iMeta]);
    WriteLine();
   }
   else
    WriteLine("  No '" + domain + "' Metadata found." + 
System.Environment.NewLine);
  }

I see this information in my GUI, but it doesn't get saved.

   Metadata
    0:  AREA_OR_POINT=Area
    1:  TIFFTAG_IMAGEDESCRIPTION="GeoEye"
    2:  TIFFTAG_DATETIME=2007:11:29 23:35:55
    3:  TIFFTAG_COPYRIGHT="(c) GeoEye"
    4:  TIFFTAG_XRESOLUTION=300
    5:  TIFFTAG_YRESOLUTION=300
    6:  TIFFTAG_MINSAMPLEVALUE=1
    7:  TIFFTAG_MAXSAMPLEVALUE=2047
    8:  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)

  IMAGE_STRUCTURE Metadata
    0:  INTERLEAVE=BAND

  No 'RPC' Metadata found.

  No 'SUBDATASETS' Metadata found.

  No 'GEOLOCATION' Metadata found.



More information about the gdal-dev mailing list