[gdal-dev] GDALDriver question

Alejandro Mostovoi ahmostovoi at gmail.com
Wed Feb 10 16:50:48 EST 2010


Thanks for your answer.

Alejandro.


On 10 February 2010 17:12, Even Rouault <even.rouault at mines-paris.org>wrote:

> Did you have a look at http://gdal.org/gdal_8h.html ?
>
> Extract from gcore/gdal_misc.cpp that answer all your questions :
>
> /* -------------------------------------------------------------------- */
> /*      --formats                                                       */
> /* -------------------------------------------------------------------- */
>        else if( EQUAL(papszArgv[iArg], "--formats") )
>        {
>            int iDr;
>
>            printf( "Supported Formats:\n" );
>            for( iDr = 0; iDr < GDALGetDriverCount(); iDr++ )
>            {
>                GDALDriverH hDriver = GDALGetDriver(iDr);
>                const char *pszRWFlag, *pszVirtualIO;
>
>                if( GDALGetMetadataItem( hDriver, GDAL_DCAP_CREATE, NULL ) )
>                    pszRWFlag = "rw+";
>                else if( GDALGetMetadataItem( hDriver, GDAL_DCAP_CREATECOPY,
>                                              NULL ) )
>                    pszRWFlag = "rw";
>                else
>                    pszRWFlag = "ro";
>
>                if( GDALGetMetadataItem( hDriver, GDAL_DCAP_VIRTUALIO, NULL)
> )
>                    pszVirtualIO = "v";
>                else
>                    pszVirtualIO = "";
>
>                printf( "  %s (%s%s): %s\n",
>                        GDALGetDriverShortName( hDriver ),
>                        pszRWFlag, pszVirtualIO,
>                        GDALGetDriverLongName( hDriver ) );
>            }
>
>            CSLDestroy( papszReturn );
>            return 0;
>        }
>
>
>
> Le Wednesday 10 February 2010 21:09:21 Alejandro Mostovoi, vous avez
> écrit :
> > Hi All,
> >
> > I need to get the Long Format Name and the Code of GDAL Raster Formats
> > (BMP, FAST, ENVI, etc) from a GDALDataset. I'm looking for a method like
> > OGRSFDriver::GetName();
> >
> > Any idea?
> >
> > Thanks in Advance.
> > Alejandro.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20100210/71fb4b9a/attachment.html


More information about the gdal-dev mailing list