[gdal-dev] Resquest for comments (RFC 36)

Even Rouault even.rouault at mines-paris.org
Tue Oct 4 02:09:16 EDT 2011


Le mardi 04 octobre 2011 04:52:09, Daniel Morissette a écrit :
> On 11-10-03 10:04 PM, Frank Warmerdam wrote:
> > I believe that is because it is hard to know if HFA:test.tif was really
> > something other than a request for the HFA driver.  It could actually
> > be a file named "HFA:test.tif

Daniel's suggestion to not fallback to the regular Open() that loops over the 
driver, once we've recognized the driver name, could make sense actually. 
Because Ivan's code is not called if the "drivername:filename" is a regular 
filename ( see if ( oOpenInfo.bStatOK == false && strstr( pszFilename, ":" ) != 
NULL  )  ).

> > " or it could be that another driver happens
> > to use the HFA: prefix to mean something.

That would be pretty confusing and should be banned. I hope there's no such 
case in the current code base !

> Um... the best I can say then is -0 in the hope that we can find a
> better delimiter or syntax. Unfortunately I just can't come up with a
> better option at the moment.

There's already another GDALOpenInternal() that I pushed some time ago for the 
purpose of the NITF driver (that needs to restrict the opening of JPEG2000 
datastream to the JPEG2000 capable driver that are PAM capable). That 
GDALOpenInternal() accepts a list of driver names as an additional argument. 

That could be an alternative to Ivan's solution. The downside of this approach 
is that as it is a new API, you need to retrofit all callers, such as gdalinfo, 
gdal_translate, and all the other gdal utilities/scripts etc.., to add a new 
user option to specify the driver name(s).

So I don't see any obvious winner between the 2 approachs (embedding the 
driver name in the string vs providing a new argument to GDALOpenXXX() )

> 
> > I'm not convinced that this is necessary.  I have had a hope for
> > some time to provide a standard way of binding up open options,
> > including the driver name, for OGR as demonstrated by a
> > 
> > request like:
> >    @driver=ingres,dbname=test
> 
> Unfortunately "@driver=ingres,dbname=test.tif" is also a valid filename,
> so we'd have the same problem as with "HFA:test.tif" above.
> 
> I also think it is important to be consistent between GDAL and OGR for
> something like this.
> 
> Once again, I'm not trying to kill the idea, just pointing the flaws in
> the hope that the someone in the group will find a more predictable
> mechanism.


More information about the gdal-dev mailing list