Hello Hao

Le 30/08/16 à 15:37, phuong hao nguyen thi a écrit :

> The present, I would like to also read the HDF file
> format. Does anyone have suggestions about the library? 

I think that the UCAR NetCDF library can read it. You can try adding the
following dependency in your pom.xml file:

    <dependency>
      <groupId>edu.ucar</groupId>
      <artifactId>cdm</artifactId>
    </dependency>

Then, you can try to open a file with something like below:

    import ucar.nc2.*;
    ...
    try (NetcdfFile file = NetcdfFile.open("/path/to/your/file")) {
        Attribute attr = file.findAttributes("someAttribute");
        if (attr != null) {
            String value = attr.getStringValue();
        }
    }

But a NetCDF or a HDF file can have any attributes, a little bit like
XML. In most NetCDF files, the meaning of attributes is describes by the
"Climate and Forecast conventions" at http://cfconventions.org/. I do
not know if HDF files follow the same conventions.


> Do we have a
> documentation online about some standard HDF attributes?

For HDF, I do not know. But maybe the provider of your data has some
documentation on their web site? Can you be more specific about with
kind of HDF data you want to read?

    Martin


Reply via email to