Re: [gdal-dev] GDALDatasetDriver->poDriver = NULL

2020-10-08 Thread Momtchil Momtchev
On 08/10/2020 18:22, Even Rouault wrote: > 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 GD

Re: [gdal-dev] GDALDatasetDriver->poDriver = NULL

2020-10-08 Thread Even Rouault
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

Re: [gdal-dev] GDALDatasetDriver->poDriver = NULL

2020-10-08 Thread Momtchil Momtchev
Does a GDALDriver know his own name? GetDescription from GDALMajorObject maybe? 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. On 08/10/2020 17:38, E

Re: [gdal-dev] GDALDatasetDriver->poDriver = NULL

2020-10-08 Thread Mateusz Loskot
On Thu, 8 Oct 2020 at 17:17, Momtchil Momtchev wrote: > > Is it normal that for this code > > int main() { > GDALAllRegister(); > const char *pszFormat = "GTiff"; > GDALDriver *driver = GetGDALDriverManager()->GetDriverByName(pszFormat); > if (driver == nullptr) { > pri

Re: [gdal-dev] GDALDatasetDriver->poDriver = NULL

2020-10-08 Thread Even Rouault
On jeudi 8 octobre 2020 17:17:29 CEST Momtchil Momtchev wrote: > Hello, > > > Is it normal that for this code > > int main() { > GDALAllRegister(); > const char *pszFormat = "GTiff"; > GDALDriver *driver = > GetGDALDriverManager()->GetDriverByName(pszFormat); if (driver

[gdal-dev] GDALDatasetDriver->poDriver = NULL

2020-10-08 Thread Momtchil Momtchev
    Hello,     Is it normal that for this code int main() {     GDALAllRegister();     const char *pszFormat = "GTiff";     GDALDriver *driver = GetGDALDriverManager()->GetDriverByName(pszFormat);     if (driver == nullptr) {     printf("driver is null\n");     return 1;     }     std: