[GRASS5] floating AI ASCII GRID import

Hamish hamish_nospam at yahoo.com
Thu Dec 2 19:21:57 EST 2004


> > v.in.ogr:   not sure how to do the read/write check.
> >   [as these are both reading functions, reporting 'write' support
> >    doesn't really matter, but is interesting..]
> 
> In C++ you would do a test like this to see if a driver supports
> creating new datasources.  I thnk the C equivelent is to call
> OGR_Dr_TestCapability(). 
> 
>         if( !poDriver->TestCapability( ODrCCreateDataSource ) )
>         {
>             printf( "%s driver does not support data source
>             creation.\n",
>                     pszFormat );
>             exit( 1 );
>         }



This is what I have so far:

	for(iDriver = 0; iDriver < OGRGetDriverCount(); iDriver++) {
	    OGRSFDriverH *poDriver = OGRGetDriver(iDriver);
	    fprintf(stdout, "  %s\n", OGR_Dr_GetName(poDriver));

	/*** TODO: read/write check:
	    if( OGR_Dr_TestCapability(poDriver, "??") )
		fprintf(stdout, " %s (read/write)\n",
		    OGR_Dr_GetName(poDriver) );
	    else
		fprintf(stdout, "  %s (read only)\n",
		    OGR_Dr_GetName(poDriver) );
	***/

	}


What I don't understand is what *pszCap string to give 
int CPL_DLL OGR_Dr_TestCapability( OGRSFDriverH, const char * );
as a test. (if that works at all)


Hamish




More information about the grass-dev mailing list