Skip to content

Handling different types from the HDF hierarchical tree (dataset, group, attribute) #136

Closed
@caiohamamura

Description

@caiohamamura

As it is we only have the option to get a Vec<String> of the members non-recursively, but we don't even know which type of member this actually is, members may be dataset or group and should be handled differently in any application.

You could actually try to code something like this to check if it is a group:

if let Ok(member_names) = hdf_file.get_members() {
    for member_name in member_names {
        if let Ok(group) = obj.get_group(member_name.as_str()) {
            // This is a group, do something with the group
        } else {
            // This is not a group
        } 
    }
}

But if this is not a group at all, although the program does run it will output some nasty HDF5 errors like this:

HDF5-DIAG: Error detected in HDF5 (1.10.5) thread 9184:
  #000: D:\src\osgeo4w64\src\hdf5\src\H5G.c line 470 in H5Gopen2(): unable to 
open group
    major: Symbol table
    minor: Can't open object

So, is there any better way to browse the HDF hierarchical tree?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions