[gdal-dev] Question about GDALDriverManager + gdal2wktraster

Jorge Arévalo jorge.arevalo at gmail.com
Tue Jul 7 06:39:26 EDT 2009


2009/7/7 Frank Warmerdam <warmerdam at pobox.com>:

> Looking at:
>  http://www.gis4free.org/gdal_wktraster/frmts/wktraster/wktrasterdataset.cpp
> I see:
>    if( GDALGetDriverByName( "WKTRaster" ) == NULL )
>    {
>        poDriver = new GDALDriver();
>        poDriver->SetDescription( "WKT Raster driver" );
> OK, so the problem is that your GetDriverByName() call is
> not checking for the short name you set as the description.
> Even though it is called Description this is really the
> driver short name and it should be a well behaved short
> keyword.  So please change it to:
>   poDriver->SetDescription( "WKTRaster" );

Changed and working :-). Many thanks, Frank

> If you find the driver writing tutorial is unclear on this point please
> propose a change to the tutorial.

Re-reading the driver tutorial, I should figure myself out. When you
pass the mouse over "GDALDriverByName" in
you can read "Fetch a driver based on the short name". And the
description "is the short name".

At the most, maybe you can write something like:

"The description is the short name for the format. *The one that you
have to use if you want to fetch the driver by name*. This is a unique
name for this format, often used to identity the driver in scripts and
commandline programs. Normally 3-5 characters in length, and matching
the prefix of the format classes. (mandatory)"

> Best regards,

Best regards,

> --
> ---------------------------------------+--------------------------------------
> I set the clouds in motion - turn up   | Frank Warmerdam,
> warmerdam at pobox.com
> 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