[geotk] questions about GridCoverage

Pablo Rozas Larraondo p.rozas.larraondo at gmail.com
Thu Feb 2 07:55:03 EST 2012


Hello,

I'm working with the NetcdfImageReader. I know it's a work in progress at
the time but as a beginner is hard to know if my problems are due to my
lack of understanding or to incomplete API functionalities ;-)

I've got some conceptual questions and problems working with a sample grib
file. To describe the data I've used the NetCDF API to display some
information about it. After I present my GEOTK code and my questions.


NetCDF API CODE:
NetcdfFile f = NetcdfFile.open("~/myfile.grb");
List<Variable> variables = ds.getReferencedFile().getVariables();

[...Loop List<Variable> displaying the following info:...]

// the name and datatype
System.out.print(variables.get(i).getName());
System.out.print(", ");
System.out.print(variables.get(i).getDataType());
System.out.print(": ");

// the variable ranges of the grid
System.out.print(variables.get(i).getRanges());
System.out.print(" ");
// the unit

System.out.println(variables.get(i).getUnitsString());

OUTPUT:
Precipitation_rate, float: [0:0, 0:0, 0:468, 0:564] kg m-2 s-1
Low_cloud_cover, float: [0:0, 0:0, 0:468, 0:564] %
U_component_of_wind, float: [0:0, 0:5, 0:468, 0:564] m s-1
...

GEOTK API CODE:
NetcdfImageReader netcdfReader = new NetcdfImageReader(null);
netcdfReader.setInput("~/myfile.grb");

ImageCoverageReader reader = new ImageCoverageReader();
reader.setInput(netcdfReader);

GridCoverage2D uwindcoverage = reader.read(2, null);
System.out.println(uwindcoverage.toString());

OUTPUT:
GridCoverage2D["U_component_of_wind", BOX4D(-706.2221645900614
-586.2304882997278 NaN NaN, 706.2778354099386 586.2695117002722 NaN NaN),
NetcdfCRS.Compound["time height_above_ground y x"]]
│   RenderedSampleDimension("U_component_of_wind":[])
│       GeophysicsCategory(“No data”:[NaN(-9999…-9999)])
└ Image=WritableRenderedImageAdapter[] as views [NATIVE, PACKED, RENDERED,
GEOPHYSICS, PHOTOGRAPHIC]


QUESTIONS:
1.- How ImageCoverageReader decides which of the 6 xy planes it selects?
(this variable has 6 z values)

2.- uwindcoverage.evaluate(new Point2D.Float(X, Y), values) returns values
as "[F at 10d0eae" when I expect [float] according to NetCDF variable
descriptor. How should I read this values?

3.- Does it makes sense that: uwindcoverage.getDimension() = 4, if its
defined as 2D?

4.- Do you consider convenient to define new methods for GridCoverage2D as:
.getMaxValue(), .getMinValue(), .getAverageValue(), .getUnit(), etc to get
information similar to the one contained in the original grib file? I think
they could be very helpful for application development...

Thanks for your help,

Pablo Rozas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geotoolkit/attachments/20120202/482ac3e4/attachment.html


More information about the Geotoolkit mailing list