[gdal-dev] RFC 46 GDAL/OGR unification adopted and commited

Etienne Tourigny etourigny.dev at gmail.com
Sat May 24 13:29:35 PDT 2014


On Sat, May 24, 2014 at 4:54 PM, Even Rouault
<even.rouault at mines-paris.org>wrote:

> Le samedi 24 mai 2014 21:28:39, Etienne Tourigny a écrit :
> > Hi Even, great work!
> >
> > Quick testing was fine and revealed no errors.
> >
> > I was able to compile it in QGIS master very easily. The only "issue" I
> > encountered was related to GDALRegisterAll() and OGRAllRegister()
> > registering all drivers (raster and vector), requiring to ignore the
> > vector-only drivers in the raster-only related code in QGIS.
>
> Yeah, I've noticed a similar issue in PostGIS because they unload now all
> drivers by default except those in a white list, and they still needed a
> OGR
> driver.


> >
> > May I suggest a change that would improve backwards-compatibility and
> avoid
> > unwanted issues? Perhaps these 2 functions should only register raster or
> > vector drivers (as in GDAL 1.x), instead of all drivers, and a new
> function
> > would register both raster and vector drivers. This would ensure old code
> > behaves as previously, and ensure that no extra drivers are loaded and
> > probed when only raster/vector drivers are needed.
> >
> > Just to be clearer here is how I would see it:
> > GDALRegisterAll() -> registers raster drivers (those with
> > GDAL_DCAP_RASTER="YES")
> > OGRAllRegister() -> registers vector drivers (those with
> > GDAL_DCAP_VECTOR="YES")
> > GDALRegisterDrivers() -> registers all drivers
> >
> > On the other habd, I imagine this may not be easy to implement and could
> > cause some confusion in the future.
>
> That could be done, although I'm not sure it is really worth doing. There
> will
> be likely other changes in GDAL 2.0 development that will require
> adjustments
> in calling code.
> In your suggestion a driver that has a raster and vector face (like the re-
> unified PDF and PCIDSK done in RFC 46) should be listed in the two lists.
>
> Actually in QGIS case, the issue is likely not driver registration, but
> driver
> listing (in QGIS, both GDAL and OGR driver should be registered). So that
> wouldn't help.
>

sort of - the side effect of registering all vector drivers was that vector
drivers were listed, so I filtered them using the GDAL_DCAP_RASTER



>
> > Also, probing optimization can instead
> > be achieved using GDALOpenEx() specifying raster vs.vector drivers.
>
> GDALOpen() will only probe drivers that have raster capabilities. It is an
> alias of GDALOpenEx(filename, GDAL_OF_RASTER | update_flag )
>

right- got confused there

anyway - if important issues come up it might be worth changing this, if
not no biggie. Again congrats!

Etienne

>
> Even
>
> --
> Geospatial professional services
> http://even.rouault.free.fr/services.html
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140524/678ba53d/attachment-0001.html>


More information about the gdal-dev mailing list