[gdal-dev] limiting drivers that get registered

Even Rouault even.rouault at spatialys.com
Thu Mar 8 04:34:11 PST 2018


Ben,

> Is it possible to limit the number of drivers compiled into GDAL (I am
> guessing not)?

You have some knobs with the various ./configure or nmake.opt switch, but yes generally 
drivers that don't require external dependencies will always be compiled in.
Editing manually the makefiles can help creating a smaller GDAL build but that can be a non-
obvious task because of inter-driver dependencies.

There's also a wiki page about that
https://trac.osgeo.org/gdal/wiki/BuildingOnUnixWithMinimizedDrivers
(I can see that I created a patch for a minimal build 10 years ago. Likely doesn't apply out of 
the box :-) )


> Alternatively, would a patch be welcome to read a
> confguration file to limit which drivers are registered at initialisation?

If you use GDAL as a library from your own code (C/C++), you can also directly call the 
GDALRegister_XXXX() / OGRRegisterXXXX() functions you are interested in, instead of 
GDALAllRegister()

GDALOpenEx() also accepts a white-list of drivers to probe.

You are probably aware of the GDAL_SKIP configuration option to blacklist drivers at run-
time.

That said perhaps a GDAL_DRIVERS configuration option to whitelist could have some use.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20180308/566a7f42/attachment.html>


More information about the gdal-dev mailing list