GDAL meta data

Frank Warmerdam warmerdam at p...
Wed Apr 3 17:13:44 EST 2002


A. B. wrote:
> Hi Frank,
> 
> 
> I think I did not understand your previous comment. Yes you can go ahead and the
> ability to extract specialized meta-data from ceos input. In fac, I examined gdal code
> (core/gdalmajorobject) and at this moment GetMetadata returns a NULL string if
> a domain is given !!

Ahmed,

It is necessary to override the GetMetadata() method on the SAR_CEOSDataset
class to get the desired behaviour. I have committed the required code to
implement access to raw CEOS record data via the GDAL metadata api. The
inline documentation says:


/************************************************************************/
/* GetMetadata() */
/* */
/* We provide our own GetMetadata() so that we can override */
/* behavior for some very specialized domain names intended to */
/* give us access to raw record data. */
/* */
/* The domain must look like: */
/* ceos-FFF-n-n-n-n:r */
/* */
/* FFF - The file id - one of vol, lea, img, trl or nul. */
/* n-n-n-n - the record type code such as 18-10-18-20 for the */
/* dataset summary record in the leader file. */
/* :r - The zero based record number to fetch (optional) */
/* */
/* Note that only records that are pre-loaded will be */
/* accessable, and this normally means that most image records */
/* are not available. */
/************************************************************************/

The following example script demonstrates use:
#!/usr/bin/env python

import gdal

file = gdal.Open( '/u/data/ceos/ottawa_patch/ottawa_patch.img' )

print file.GetMetadata( 'ceos-vol-192-192-18-18:0' )

md = file.GetMetadata( 'ceos-vol-192-192-18-18' )
print md['RawRecord']


It produces the following results - note that all binary zero characters
are converted to spaces, and that all the prefix data is included in the
returned string. The

warmerda at gdal[988]% testceos.py
{'RawRecord': '\001\300\300\022\022 \001hA CCB-CCT-0002 E AAPP 1.99 input 
RSAT-1-SAR-SGF 1996011223070698 1 1 1 1 1 1 11999122014282700CANADA CCRS 
APP 3 5 
input 
'}
`ÀÀqq `hA CCB-CCT-0002 E AAPP 1.99 input RSAT-1-SAR-SGF 19960118 1 1 1 1 
1 1 11999122014282700CANADA CCRS APP 3 5 
input 


Let me know if you have any questions.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at p...
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent






More information about the Gdal-dev mailing list