[geotk] questions about GridCoverage
Martin Desruisseaux
martin.desruisseaux at geomatys.fr
Thu Feb 2 12:20:05 EST 2012
Le 02/02/12 17:54, Pablo Rozas Larraondo a écrit :
> Thanks again for your help, it's much clear for me now except one point in the
> first question. I more or less understand the process of reading variables
> from the ImageCoverageReader through indexes but, what happens when one of
> this variables has more than one z value?
>
> For "Low_cloud_cover" it's clear because there is only one xy coverage:
> Low_cloud_cover, float: [0:0, 0:0, 0:468, 0:564] %
>
> But what happens with "U_component_of_wind", once I've read the variable how
> do I change between the 6 different coverages it contains?
> U_component_of_wind, float: [0:0, 0:5, 0:468, 0:564] m s-1
In the ImageCoverageReader.read(...) method, there is GridCoverageReadParam
parameter. You can create a parameter like below, assuming that the z range are
at dimension 2 (zero-based index):
Envelope env = new GeneralEnvelope(4); // 4-dimensional
env.setRange(2, zmin, zmax);
GridCoverageReadParam param = new GridCoverageReadParam();
param.setEnvelope(env);
Same idea apply to time value.
Under the hood, the CoverageReader will try to map the z and t dimension to
standard Java API using the DimensionSlice class. This class is inspired from
the WCS standard but its usage is not trivial, so it is better to check for
making sure that the were no error (that the coverage reader took the right z
value).
Martin
More information about the Geotoolkit
mailing list