GDAL Driver Changes

Frank Warmerdam warmerdam at p...
Wed Jun 12 17:20:37 EDT 2002


Folks,

I have made some changes to the way information about GDALDrivers is stored.
GDALDriver's are derived from GDALMajorObject which automatically supports
metadata, so I decided to store a bunch of info in the metadata.

The pszShortName is now the descriptions (accessed via the GetDescription()
and SetDescription() methods). The rest of the values are stored as
metadata.

I have also added MIMETYPE and EXTENSION metadata. The registration of the
GeoTIFF driver demonstrates this fairly completely:

poGTiffDriver = poDriver = new GDALDriver();

poDriver->SetDescription( "GTiff" );
poDriver->SetMetadataItem( GDAL_DMD_LONGNAME, "GeoTIFF" );
poDriver->SetMetadataItem( GDAL_DMD_HELPTOPIC, "frmt_gtiff.html" );
poDriver->SetMetadataItem( GDAL_DMD_MIMETYPE, "image/tiff" );
poDriver->SetMetadataItem( GDAL_DMD_EXTENSION, "tif" );
poDriver->SetMetadataItem( GDAL_DMD_CREATIONOPTIONLIST, "
<CreationOptionList>
<Option name='COMPRESS' type='string-select'>
<Value>NONE</Value>
<Value>PACKBITS</Value>
<Value>JPEG</Value>
<Value>LZW</Value>
<Value>DEFLATE</Value>
</Option>
<Option name='INTERLEAVE' type='string-select'>
<Value>BAND</Value>
<Value>PIXEL</Value>
</Option>
<Option name='TILED' type='boolean' description='Switch to tiled format'/>
<Option name='TFW' type='boolean' description='Write out world filet'/>
<Option name='BLOCKXSIZE' type='int' description='Tile Width'/>
<Option name='BLOCKYSIZE' type='int' description='Tile/String Height'/>
</CreationOptionList>" );

Note that there is also the CREATIONOPTIONLIST metadata which is intended to
be a description of all the creation options supported by a format. This
is currently not being used for anything, but it is my intention to write
a standard parser for the information and to do automatic validation in the
generate GDALCreate() and GDALCreateCopy() code. This info can also be used
to populate GUIs if/when that should be necessary.

Note that the work related to mimetype and extension was funded by i-cubed
(www.i3.com) and will be taken advantage of by MapServer.

Anyone with a private format implementation will need to update their
driver registration code to set those values (at least Description and longname)
that are available in the new way. Anyone doing a CVS update should take
care to do a clean build since various classes changed in size and layout.

PS. gdal_translate will now only list formats supported for output.

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