[geotk] Netcdf Coverage
martin.desruisseaux at geomatys.fr
Thu Dec 9 04:18:56 EST 2010
Le 09/12/10 01:48, Fabien Carrion a écrit :
> I am trying to move my project from geotools to geotoolkit, but I have a
> problem. In geotools, the class NetcdfImageReader has a method to
> getStatistics min and max values of a variable, which doesn't exists in
Actually the information is still there, but in a different way. A more standard
way to get this kind of information with the Image I/O API is using IIOMetadata.
In Geotk, we defined a SpatialMetadataFormat as a subset of ISO 19115-2. You can
see the format here:
In the right column, there is minValue and maxValue attributes. You can access
them as below:
NetcdfImageReader reader = ...,
SpatialMetadata metadata = reader.getImageMetadata(0);
/// From that point, there is a choice. You can explore
// the metadata using the standard API like a XML tree.
// Or you can use the convenience methods below.
List<SampleDimension> bands = metadata.getListForType(SampleDimension.class);
SampleDimension firstBand = bands.get(0);
Double minValue = firstBand.getMinValue(); /// WARNING: Can be null!/
Double maxValue = firstBand.getMaxValue(); /// WARNING: Can be null!/
*Tip:* If you wish to explore visually the metadata of your NetCDF file, the
following may be useful (the following widget is defined in the
ImageFileChooser chooser = new ImageFileChooser("NetCDF", true);
Then select your NetCDF file, and click on the "Metadata" tabs on the right
side. Select the metadata format in the combo box, and you should see the
metadata tree just below.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Geotoolkit