[gdal-dev] DIMAP driver fail to get some meta data
Even Rouault
even.rouault at mines-paris.org
Thu Nov 6 14:17:31 EST 2008
Guillaume,
yes, what you've observed is consistant with the source code of the driver.
To improve the situation, I've added in r15687 support for setting metadata at
the raster band level (that is to say with GDALRasterBand::GetMetadata)
Here's the new output :
$ apps/gdalinfo dimap/DN000340T_L1R.dim
Driver: DIMAP/SPOT DIMAP
Files: dimap/DN000340T_L1R.dim
dimap/DN000340T_L1R.tif
....
Metadata:
DATASET_PRODUCER_NAME=DMC International Imaging Ltd.
DATASET_PRODUCTION_DATE=2006-06-08
MISSION=NIGERIASAT
IMAGING_DATE=2006-01-30
IMAGING_TIME=09:18:22
GEOMETRIC_PROCESSING=1R
RADIOMETRIC_PROCESSING=Cubic convolution
SPECTRAL_BAND_INDEX=1
SPECTRAL_BAND_DESCRIPTION=NIR
SPECTRAL_PHYSICAL_GAIN=0.6376299283778701
SPECTRAL_PHYSICAL_BIAS=0.0642515909964508
SPECTRAL_PHYSICAL_UNIT=W/m2/sr/m-6
....
Band 1 Block=6703x8 Type=Byte, ColorInterp=Red
Metadata:
BAND_DESCRIPTION=NIR
PHYSICAL_GAIN=0.6376299283778701
PHYSICAL_BIAS=0.0642515909964508
PHYSICAL_UNIT=W/m2/sr/m-6
Band 2 Block=6703x8 Type=Byte, ColorInterp=Green
Metadata:
BAND_DESCRIPTION=RED
PHYSICAL_GAIN=0.6190674084836884
PHYSICAL_BIAS=0.0666344554873623
PHYSICAL_UNIT=W/m2/sr/m-6
Band 3 Block=6703x8 Type=Byte, ColorInterp=Blue
Metadata:
BAND_DESCRIPTION=GREEN
PHYSICAL_GAIN=0.717558361863802
PHYSICAL_BIAS=0.019273652406175568
PHYSICAL_UNIT=W/m2/sr/m-6
In case someone relied on the SPECTRAL_xxx metadata items in the dataset
metadata, I've kept them but they should be considered as a deprecated way of
getting the metadata at the raster band level.
Best regards,
Even
Le Wednesday 05 November 2008 16:39:42 guillaume huby, vous avez écrit :
> I have some trouble getting some meta data using DIMAP Driver.
>
> gdalinfo --version
>
> > GDAL 1.6.0dev, FWTools 2.2.8, released 2008/10/29
>
> Sample data can be found here :
> ftp://ftp.dmcii.com/samples/32m_MS_L1R/DN000340T_L1R.zip
>
> The meta data file contains this data :
>
> ...
>
> > <Image_Interpretation>
> > <Spectral_Band_Info>
> > <BAND_INDEX>1</BAND_INDEX>
> > <BAND_DESCRIPTION>NIR</BAND_DESCRIPTION>
> > <PHYSICAL_GAIN>0.6376299283778701</PHYSICAL_GAIN>
> > <PHYSICAL_BIAS>0.0642515909964508</PHYSICAL_BIAS>
> > <PHYSICAL_UNIT>W/m2/sr/m-6</PHYSICAL_UNIT>
> > </Spectral_Band_Info>
> > <Spectral_Band_Info>
> > <BAND_INDEX>2</BAND_INDEX>
> > <BAND_DESCRIPTION>RED</BAND_DESCRIPTION>
> > <PHYSICAL_GAIN>0.6190674084836884</PHYSICAL_GAIN>
> > <PHYSICAL_BIAS>0.0666344554873623</PHYSICAL_BIAS>
> > <PHYSICAL_UNIT>W/m2/sr/m-6</PHYSICAL_UNIT>
> > </Spectral_Band_Info>
> > <Spectral_Band_Info>
> > <BAND_INDEX>3</BAND_INDEX>
> > <BAND_DESCRIPTION>GREEN</BAND_DESCRIPTION>
> > <PHYSICAL_GAIN>0.717558361863802</PHYSICAL_GAIN>
> > <PHYSICAL_BIAS>0.019273652406175568</PHYSICAL_BIAS>
> > <PHYSICAL_UNIT>W/m2/sr/m-6</PHYSICAL_UNIT>
> > </Spectral_Band_Info>
> > </Image_Interpretation>
> > ...
>
> And gdalinfo outputs :
> >gdalinfo DN000340T_L1R.dim
> > Driver: DIMAP/SPOT DIMAP
> > ...
> > Metadata:
> > ...
> > SPECTRAL_BAND_INDEX=1
> > SPECTRAL_BAND_DESCRIPTION=NIR
> > SPECTRAL_PHYSICAL_GAIN=0.6376299283778701
> > SPECTRAL_PHYSICAL_BIAS=0.0642515909964508
> > SPECTRAL_PHYSICAL_UNIT=W/m2/sr/m-6
> > ...
>
> The problem is that there is spectral info only for first band. I would
> like to see the data for each band.
>
> I also made a C++ program using the API ( GDALDataset::GetMetadata and
> GDALRasterBand::GetMetadata )giving no more results.
>
> Is there some turn-around to get the meta-data using the driver ?
> Should I submit a bug ?
>
> Thank you for your reply.
>
> Guillaume.
More information about the gdal-dev
mailing list