For some TIF files, the GDAL raster reader (vtkGDALRasterReader class) does not fully initialize its internal GDALData object. Specifically, the GetSpacialRef method of the object returns a nullptr with certain TIF files when I don’t think it should. In vtkGDALRasterReader.cxx, line 643-647 the following code throws an exception:
const char* gcpProj = this->GDALData->GetSpatialRef()->GetName();
The call to GetSpatialRef() here returns a nullptr on some files. I have hacked in a null guard on a local fork that allows the file to continue reading and stops the library from crashing my application, but that can’t be the correct solution here. Surely the correct solution would be ensuring that the GDALData object always initializes the underlying object that GetSpatialRef() should be a pointer of.
Has anyone else encountered this? What is the best way forward to fix it? Should I create a pull request on the GitLab board?