Opened 11 years ago

Closed 11 years ago

#4076 closed defect (fixed)

HDF5 GetProjectionRef returns NULL sometimes

Reported by: warmerdam Owned by: warmerdam
Priority: normal Milestone: 1.8.1
Component: GDAL_Raster Version: 1.8.0
Severity: normal Keywords: HDF5


I'm working with a HDF5 dataset with Gdal 1.8.0, I open it with the HDF5Image driver. The image metadata is read OK from what I can see, but when I want to execute the GetProjectionRef() method, it returns null, even if the documentation says it wouldn't return any null pointer.

I've traced the null pointer to HDF5ImageDataset::CreateProjections(), in line 562 it reads

poH5Objects=HDF5FindDatasetObjects( poH5RootGroup,  "Latitude" );
    if( !poH5Objects ) {
	return CE_None;

Since my HDF5 file doesn't have a "Latitude" dataset, the function returns without setting the pszProjection variable, it remains null and is never being set as an empty string, as the GetProjectionRef consist only in:

const char *HDF5ImageDataset::GetProjectionRef( )

    return pszProjection;  //

Change History (1)

comment:1 by warmerdam, 11 years ago

Resolution: fixed
Status: newclosed

Fixed in trunk (r22340) and 1.8 branch (r22341).

Note: See TracTickets for help on using tickets.