On Mon, Oct 3, 2011 at 6:14 PM, Daniel Morissette <dmorisse...@mapgears.com> wrote: > I like the idea, especially since it can increase performance in some cases. > However unless I'm mistaken the proposed patch seems to fall back on the > regular test-open loop when the GDALOpenInternal() call with the explicit > driver name failed, no matter why it failed. e.g. I specify the invalid > "hfa:test.tif" open string, then I should get a NULL return value and not a > handle to a TIFF file.
Daniel, 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" or it could be that another driver happens to use the HFA: prefix to mean something. I believe this is an effort to avoid failure in these cases. > The patch would need to be reworked for this, but I think that if the > GetDriverByName() call succeeds (i.e. the driver name prefix is recognized > by GDAL) and the call to poDriver->pfnOpen() fails then we should return > NULL to the application code (and not fall back on the test-open loop). > OTOH, if the GetDriverByName() lookup failed, then we should fall back on > the test-open loop. > > Also, if we implement this mechanism in GDAL, then we'd have to provide it > in OGR as well to be consistent. 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 One objection I had previously to Ivan's proposal is that I'm interested in pursuing this general purpose mechanism for many open options in OGR and in GDAL. But since I haven't gotten to it for so long there is no point in holding up Ivan's fairly straight forward change. Nevertheless, I'm hesitant to push his change to OGR unnecessarily. Best regards, -- ---------------------------------------+-------------------------------------- I set the clouds in motion - turn up | Frank Warmerdam, warmer...@pobox.com light and sound - activate the windows | http://pobox.com/~warmerdam and watch the world go round - Rush | Geospatial Software Developer _______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/gdal-dev