[QGIS-Developer] Question on FGDB support for "Save As" / "Export"

Even Rouault even.rouault at spatialys.com
Thu Aug 2 06:17:41 PDT 2018


On jeudi 2 août 2018 19:34:54 CEST Nyall Dawson wrote:
> On Thu, 2 Aug 2018 at 18:21, Andreas Neumann <a.neumann at carto.net> wrote:
> > However - I wonder if there would be a way to support both drivers? The
> > Open Source driver as default for reading. And the FGDB driver for
> > writing?
> That's a great idea!
> 
> In the QGIS world we'd have to compromise a bit here and not allow
> editing of existing layers (as you'd normally get with the closed
> driver). I.e. we'd only use it when writing an existing layer out to a
> copy on disk (e.g. via right click menu on a vector layer). But still,
> allowing layers to be saved as a geodatabase would be a step forward.
> 
> I'm not sure how this change would need to be made though. At the
> moment if you install the closed driver in osgeo4w it's always used,
> for both reading and writing layers. Even/Jürgen is this an osgeo4w
> thing or a GDAL thing? Is it possible to have two drivers installed
> for the one format and always read using the closed driver?

As the FileGDB driver is loaded as a plugin by GDAL, it is registered first, 
and then probed first when opening a dataset.
Banning one of the driver can be done by defining GDAL_SKIP=FileGDB or 
GDAL_SKIP=OpenFileGDB and calling GDALAllRegister() again.
It is also possible to control which drivers are allowed at dataset opening 
with GDALOpenEx() and the papszDriversAllowed argument (but that means you 
need to know this is a FileGeodatabase)

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the QGIS-Developer mailing list