[gdal-dev] GDALDatasetDriver->poDriver = NULL

Even Rouault even.rouault at spatialys.com
Thu Oct 8 09:22:32 PDT 2020


Adding back the list

> Does a GDALDriver know his own name? GetDescription from GDALMajorObject
> maybe? 

Yes, a GDALDriver knows its name. But the static method implemented by pfnOpen 
doesn't know which driver it comes from, so it doesn't set the poDriver member of the 
GDALDataset* it returns, and let that job to GDALOpen() itself. Which saves to do this in 
hundreds of drivers, and potentially forgetting to do it.

> The problem is that there is a Driver abstraction object in the
> Node.js bindings that supports opening a file through that driver. I
> guess this is the reason the original author used pfnOpen.

They should use GDALOpenEx() instead, which has an option to restrict the candidate 
driver(s).

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


More information about the gdal-dev mailing list