<div dir="ltr">hmmm may I suggest to use a short-handed version using a single character string? While it is easy in python, it's a bit cumbersome in c/c++ (requiring 3 lines of code instead of 1)<div><br></div><div>something like</div>
<div><div><span style="font-family:arial,sans-serif;font-size:13px">poDS = GDALOpenEx( "ASDFG", GDAL_OF_ALL, "driver", NULL, NULL);</span><br></div></div><div><div><div><span style="font-family:arial,sans-serif;font-size:13px">poDS = GDALOpenEx( "ASDFG", GDAL_OF_ALL, "driver1,driver2", NULL, NULL);</span><br>
</div></div></div><div><span style="font-family:arial,sans-serif;font-size:13px">or</span></div><div><div><span style="font-family:arial,sans-serif;font-size:13px">poDS = GDALOpenEx( "ASDFG", GDAL_OF_ALL, "driver1 driver2", NULL, NULL);</span><br>
</div></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div>cheers</div><div>Etienne</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 19, 2014 at 5:28 PM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@mines-paris.org" target="_blank">even.rouault@mines-paris.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Le vendredi 16 mai 2014 16:25:13, Etienne Tourigny a écrit :<br>
<div class="">> With this RFC, you could achieve this using GDALOpenEx()<br>
><br>
> e.g. GDALOpenEx( "ASDFG", GDAL_OF_ALL, "QWERTY")<br>
<br>
</div>Actually, this is an array of driver names:<br>
<br>
char** papszDrivers = CSLAddString(NULL, "QWERTY")<br>
poDS = GDALOpenEx( "ASDFG", GDAL_OF_ALL, papszDrivers, NULL, NULL);<br>
CSLDestroy(papszDrivers);<br>
<br>
or in Python<br>
<br>
gdal.OpenEx("ADSFG", allowed_drivers = ['QWERTY'])<br>
<div class=""><br>
><br>
> On Fri, May 16, 2014 at 11:01 AM, Ivan Lucena<br>
<<a href="mailto:lucena_ivan@hotmail.com">lucena_ivan@hotmail.com</a>>wrote:<br>
> > Even,<br>
> ><br>
> > Yes, it is hard to measure the impact of probing in a single file or any<br>
> > interactive command line operations.<br>
> ><br>
> > In the current API the class Driver doesn't expose the Open method:<br>
> ><br>
</div>> > *Driver drv = gdal.GetDriverByName("QWERTY");*<br>
> > *Dataset dst = drv.Open("ASDFG");*<br>
> ><br>
> ><br>
> > IMHO that is a *missing functionality* in  GDAL API.<br>
<div class="HOEnZb"><div class="h5">> ><br>
> > GDAL API is a library to support Geospatial Data Abastration not just a<br>
> > format conversion tool. You should be able the use it even if your sole<br>
> > intention is do deal with the fictitious "QWERTY" format. IMHO. Yes, you<br>
> > can delete all the driver or put then all on the black list but that may<br>
> > not be the best solution.<br>
> ><br>
> > The frustration of some user/programmer could be that they know what<br>
> > driver they want to use and they don't want to waste time probing; they<br>
> > don't want GDAL to get confused by files that can be supported by driver<br>
> > A and B; and most important they want to process a very very large<br>
> > number of files (ETL) or repeated times (WEB).<br>
> ><br>
> > The RFC 36 is just a band-aid solution. It starts from the fact that some<br>
> > drivers already haven a prefix like "HDF4:" and use it to select the<br>
> > driver. As you can see, the suggested code is not that pretty [<br>
> > <a href="http://trac.osgeo.org/gdal/ticket/3043" target="_blank">http://trac.osgeo.org/gdal/ticket/3043</a>] since there is no Driver::Open<br>
> > method available.<br>
> ><br>
> > Regards,<br>
> ><br>
> > Ivan<br>
> ><br>
> > > Date: Fri, 16 May 2014 13:36:08 +0200<br>
> > > From: <a href="mailto:even.rouault@mines-paris.org">even.rouault@mines-paris.org</a><br>
> > > To: <a href="mailto:lucena_ivan@hotmail.com">lucena_ivan@hotmail.com</a><br>
> > > CC: <a href="mailto:even.rouault@mines-paris.org">even.rouault@mines-paris.org</a>; <a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
> > > Subject: RE: [gdal-dev] Call for discussion on RFC 46: GDAL/OGR<br>
> ><br>
> > unification<br>
> ><br>
> > > Ivan,<br>
> > ><br>
> > > yes indeed, I missed that one. I'll update the RFC with it.<br>
> > > I think that the intent of RFC36 is covered by what is already proposed<br>
> ><br>
> > in RFC46<br>
> ><br>
> > > with the papszAllowedDrivers of GDALOpenEx().<br>
> > ><br>
> > > I do not think that specifying the candidate driver(s) is that usefull<br>
> > > in utilities since the time to launch them will be generally higher<br>
> > > than the probing time. But that could be easily implemented later with<br>
> > > an option<br>
> ><br>
> > if that<br>
> ><br>
> > > was really needed (e.g. gdalinfo foo.tif -driver gtiff or possibly<br>
> ><br>
> > gdalinfo<br>
> ><br>
> > > foo.jp2 -driver jp2ecw,jp2openjpeg).<br>
> > > Due to the work I did in OGR drivers to avoid repeated file access by<br>
> ><br>
> > using<br>
> ><br>
> > > GDALOpenInfo*, I don't think that GDAL drivers should be affected. And<br>
> ><br>
> > the OGR<br>
> ><br>
> > > drivers are registered after the GDAL ones. So if the file being opened<br>
> ><br>
> > is<br>
> ><br>
> > > really a GDAL dataset, the OGR drivers should have 0 impact on the<br>
> ><br>
> > opening time.<br>
> ><br>
> > > I did try to benchmark a bit that, but it is difficult to come to a<br>
> > > firm conclusion since there are many factors: hot/cold runs, whether<br>
> > > you<br>
> ><br>
> > spawn a new<br>
> ><br>
> > > process or use an existing one, etc.. And the time being measured are a<br>
> ><br>
> > few tens<br>
> ><br>
> > > of milliseconds, so very sensitive to task scheduling.<br>
> > ><br>
> > > Even<br>
> > ><br>
> > > > Even,<br>
> > > ><br>
> > > > I think that RFC 36 should be included in your list of<br>
> > > > related RFCs and should be reconsider for adoption since the<br>
> ><br>
> > unification<br>
> ><br>
> > > > would make the probing even more expensive.<br>
> > > ><br>
> > > > Regards,<br>
> > > ><br>
> > > > Ivan<br>
> > > ><br>
> > > > > From: <a href="mailto:even.rouault@mines-paris.org">even.rouault@mines-paris.org</a><br>
> > > > > To: <a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
> > > > > Date: Thu, 15 May 2014 20:47:32 +0200<br>
> > > > > Subject: Re: [gdal-dev] Call for discussion on RFC 46: GDAL/OGR<br>
> ><br>
> > unification<br>
> ><br>
> > > > > Le jeudi 08 mai 2014 00:13:22, Even Rouault a écrit :<br>
> > > > > > Hi,<br>
> > > > > ><br>
> > > > > > This is a call for discussion on "RFC 46: GDAL/OGR unification"<br>
> > > > > ><br>
> > > > > > <a href="http://trac.osgeo.org/gdal/wiki/rfc46_gdal_ogr_unification" target="_blank">http://trac.osgeo.org/gdal/wiki/rfc46_gdal_ogr_unification</a><br>
> > > > ><br>
> > > > > No reaction : no interest or no time to review yet ?<br>
> > > > > Or should I move that forward ?<br>
> > > > > But I'd prefer if such architectural changes could be a bit<br>
> ><br>
> > reviewed...<br>
> ><br>
> > > > > > Best regards,<br>
> > > > > ><br>
> > > > > > Even<br>
> > > > ><br>
> > > > > --<br>
> > > > > Geospatial professional services<br>
> > > > > <a href="http://even.rouault.free.fr/services.html" target="_blank">http://even.rouault.free.fr/services.html</a><br>
> > > > > _______________________________________________<br>
> > > > > gdal-dev mailing list<br>
> > > > > <a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
> > > > > <a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
> ><br>
> > _______________________________________________<br>
> > gdal-dev mailing list<br>
> > <a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
> > <a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
<br>
--<br>
Geospatial professional services<br>
<a href="http://even.rouault.free.fr/services.html" target="_blank">http://even.rouault.free.fr/services.html</a><br>
</div></div></blockquote></div><br></div>