[gdal-dev] Resquest for comments (RFC 36)
Daniel Morissette
dmorissette at mapgears.com
Mon Oct 3 21:14:32 EDT 2011
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.
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.
Daniel
On 11-10-03 08:02 PM, Ivan Lucena wrote:
> Hi All,
>
> RFC 36: http://trac.osgeo.org/gdal/wiki/rfc36_open_by_drivername
>
> The goal of RFC 36 is to save processing time by telling GDALOpen what driver to use, avoiding the driver-probing mechanism (Where all drivers are asked to checked if they recognize the file).
>
> It works by adding the driver name before the file-name as in GDALOpen("hfa:example_file.img").
>
> *It is optional*. It does not invalidate the current simple filename entry that most of the drivers use nor the more complex "filename" string formats used by a few drivers (with things like server-name, port-number, table-name).
>
> It is intended to speed up applications or scripts that need to process a large number of datasets when it already knows what driver to use.
>
> Command line use should not be affect considerably in terms of speed but it adds the option to avoid the wrong driver from taking precedence from the intended one (#3043), ex.:
>
> $ gdalinfo ntif:/autotest/gdrivers/data/rgb.ntf"
>
> If you want to try it, a patch that implements this proposed change is available on ticket 3043 http://trac.osgeo.org/gdal/ticket/3043
>
> Please take a look and send us your comments.
>
> Regards,
>
> Ivan
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
--
Daniel Morissette
http://www.mapgears.com/
Provider of Professional MapServer Support since 2000
More information about the gdal-dev
mailing list