| org.geotools.image.io.metadata.GeographicMetadata org.geotools.image.io.netcdf.NetcdfMetadata
NetcdfMetadata | public class NetcdfMetadata extends GeographicMetadata (Code) | | Metadata from NetCDF file. This implementation assumes that the NetCDF file follows the
CF Metadata conventions.
Limitation:
Current implementation retains only the first
found in the NetCDF file or for a given variable. The
org.geotools.coverage.io package
would not know what to do with the extra coordinate systems anyway.
since: 2.4 version: $Id: NetcdfMetadata.java 27848 2007-11-12 13:10:32Z desruisseaux $ author: Martin Desruisseaux |
Method Summary | |
public void | addCoordinateAxis(CoordinateAxis axis) Adds the specified coordinate axis. | public void | addCoordinateSystem(CoordinateSystem cs) Adds the specified coordinate system. | public void | addSampleDimension(VariableDS variable) Adds sample dimension information for the specified variable. | protected boolean | forcePacking(String attribute) Returns
true if an attribute (usually the valid range) should be
converted from unpacked to packed units. | protected Format | getAxisFormat(AxisType type, String prototype) Returns a format to use for parsing values along the specified axis type. |
NetcdfMetadata | public NetcdfMetadata(ImageReader reader, NetcdfDataset file)(Code) | | Creates metadata from the specified file. This constructor is typically invoked
for creating
. Note that
ucar.nc2.dataset.CoordSysBuilder.addCoordinateSystems should have been invoked
(if needed) before this constructor.
|
NetcdfMetadata | public NetcdfMetadata(ImageReader reader, VariableDS variable)(Code) | | Creates metadata from the specified file. This constructor is typically invoked
for creating
. Note that
ucar.nc2.dataset.CoordSysBuilder.addCoordinateSystems should have been invoked
(if needed) before this constructor.
|
addCoordinateAxis | public void addCoordinateAxis(CoordinateAxis axis)(Code) | | Adds the specified coordinate axis. This method is invoked recursively
by
NetcdfMetadata.addCoordinateSystem .
Parameters: axis - The axis to add. |
addCoordinateSystem | public void addCoordinateSystem(CoordinateSystem cs)(Code) | | Adds the specified coordinate system. Current implementation can adds at most one
coordinate system, but this limitation may be revisited in a future Geotools version.
Parameters: cs - The coordinate system to add. |
addSampleDimension | public void addSampleDimension(VariableDS variable)(Code) | | Adds sample dimension information for the specified variable.
Parameters: variable - The variable to add as a sample dimension. |
forcePacking | protected boolean forcePacking(String attribute)(Code) | | Returns
true if an attribute (usually the valid range) should be
converted from unpacked to packed units. The CF
Metadata conventions states that valid ranges should be in packed units, but not
every NetCDF files follow this advice in practice. The UCAR NetCDF library applies the
following heuristic rules (quoting from
ucar.nc2.dataset.EnhanceScaleMissing ):
If
valid_range is the same type as
scale_factor (actually the wider of
scale_factor and
add_offset ) and this is wider than the external data,
then it will be interpreted as being in the units of the internal (unpacked) data.
Otherwise it is in the units of the external (packed) data.
However some NetCDF files stores unpacked ranges using the same type than packed data.
The above cited heuristic rule can not resolve those cases.
If this method returns
true , then the attribute is assumed in unpacked units no
matter what the CF convention and the heuristic rules said. If this method returns
false , then UCAR's heuristic rules applies.
The default implementation returns
false in all cases.
Parameters: attribute - The attribute (usually "valid_range" ). true if the attribute should be converted from unpacked to packed unitsregardless CF convention and UCAR's heuristic rules. See Also: ucar.nc2.dataset.EnhanceScaleMissing |
getAxisFormat | protected Format getAxisFormat(AxisType type, String prototype)(Code) | | Returns a format to use for parsing values along the specified axis type. This method
is invoked when parsing the date part of axis units like "days since 1990-01-01
00:00:00". Subclasses should override this method if the date part is formatted
in a different way. The default implementation returns the following formats:
- For
, a
DateFormat using the
"yyyy-MM-dd HH:mm:ss" pattern in UTC
.
- For all other kind of axis, a
NumberFormat .
The
is used by default for most formats because
it is relatively close to ISO (for example regarding days and months order in dates) while
using the English symbols.
Parameters: type - The type of the axis. Parameters: prototype - An example of the values to be parsed. Implementations may parse thisprototype when the axis type alone is not suffisient. For example the should uses the "yyyy-MM-dd" date pattern,but some files do not follow this convention and use the default local instead. The format for parsing values along the axis. |
|
|