[geotk] Netcdf Coverage

Fabien Carrion fabien.carrion at gmail.com
Thu Dec 9 13:01:27 EST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello Martin,

Thanks for your quick response. I have been having a few problems. I
would like to know if you need any help from me to investigate those few
problems.

Thanks!

On 12/09/2010 03:18 AM, Martin Desruisseaux wrote:
>  Hello Fabien
> 
> 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
>> geotoolkit.
> 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:
> 
> http://www.geotoolkit.org/apidocs/org/geotoolkit/image/io/metadata/SpatialMetadataFormat.html#default-formats
> 
> 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!/
> 

I have tried with the metadata on the file
ftp://ftpprd.ncep.noaa.gov/pub/data/nccf/com/nam/prod/nam.20101208/nam.t06z.egrdsf00.tm00.grib2
for the variable Albedo, which is a %. I get min -1.7976931348623157E308
max 1.7976931348623157E308 and it should be beween 0 - 100 obviously.


> *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
> geotk-widgets-swing module).
> 
>     ImageFileChooser chooser = new ImageFileChooser("NetCDF", true);
>     chooser.showOpenDialog(null);
> 
> 
> 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.
> 

Using ImageFileChooser with the file
ftp://ftpprd.ncep.noaa.gov/pub/data/nccf/com/nam/prod/nam.20101208/nam.t06z.egrdsf00.tm00.grib2

.NoSuchElementException: No element named "OffsetVectors" has been found
g.geotoolkit.image.io.metadata.MetadataAccessor.<init>(MetadataAccessor.java:512)
g.geotoolkit.image.io.metadata.MetadataAccessor.<init>(MetadataAccessor.java:291)
g.geotoolkit.image.io.metadata.MetadataProxy.invoke(MetadataProxy.java:371)
roxy12.getOffsetVectors(Unknown Source)
g.geotoolkit.image.io.metadata.MetadataHelper.formatCellDimension(MetadataHelper.java:525
g.geotoolkit.gui.swing.image.ImageFileProperties$Info.<init>(ImageFileProperties.java:745)
g.geotoolkit.gui.swing.image.ImageFileProperties.setImage(ImageFileProperties.java:281)
g.geotoolkit.gui.swing.image.ImageFileProperties.setImage(ImageFileProperties.java:377)
g.geotoolkit.gui.swing.image.ImageFileProperties$ReadInvoker.read(ImageFileProperties.java:5
g.geotoolkit.internal.image.io.Formats.selectImageReader(Formats.java:200)
g.geotoolkit.gui.swing.image.ImageFileProperties.setImageInput(ImageFileProperties.java:428)
g.geotoolkit.gui.swing.image.ImageFileProperties.setImage(ImageFileProperties.java:396)
g.geotoolkit.gui.swing.image.ImageFileProperties$Worker.doInBackground(ImageFileProperties.java:

> Regards,
> 
>     Martin
> 
> 
> 
> _______________________________________________
> Geotoolkit mailing list
> Geotoolkit at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geotoolkit

- -- 
Fabien Carrion

()  Campagne du ruban ASCII -- Contre les mails en html
/\  contre les pieces-jointes Microsoft
Web: http://fabien.carrion.free.fr/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEUEARECAAYFAk0BGXEACgkQTe/bvZWuSM/ItgCaArhaNhozSQ/lqCIXGJcYdFEx
EM4AmL1OPbwjGUXL52sChWByPUUYNaU=
=ecMp
-----END PGP SIGNATURE-----


More information about the Geotoolkit mailing list