|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.imageio.metadata.IIOMetadata
org.geotools.image.io.metadata.GeographicMetadata
org.geotools.image.io.netcdf.NetcdfMetadata
public class NetcdfMetadata
Metadata from NetCDF file. This implementation assumes that the NetCDF file follows the CF Metadata conventions.
Limitation:
Current implementation retains only the first coordinate system
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.
Field Summary |
---|
Fields inherited from class javax.imageio.metadata.IIOMetadata |
---|
controller, defaultController, extraMetadataFormatClassNames, extraMetadataFormatNames, nativeMetadataFormatClassName, nativeMetadataFormatName, standardFormatSupported |
Constructor Summary | |
---|---|
NetcdfMetadata(javax.imageio.ImageReader reader,
ucar.nc2.dataset.NetcdfDataset file)
Creates metadata from the specified file. |
|
NetcdfMetadata(javax.imageio.ImageReader reader,
ucar.nc2.dataset.VariableDS variable)
Creates metadata from the specified file. |
Method Summary | |
---|---|
void |
addCoordinateAxis(ucar.nc2.dataset.CoordinateAxis axis)
Adds the specified coordinate axis. |
void |
addCoordinateSystem(ucar.nc2.dataset.CoordinateSystem cs)
Adds the specified coordinate system. |
void |
addSampleDimension(ucar.nc2.dataset.VariableDS variable)
Adds sample dimension information for the specified variable. |
protected boolean |
forcePacking(java.lang.String attribute)
Returns true if an attribute (usually the valid range) should be
converted from unpacked to packed units. |
protected java.text.Format |
getAxisFormat(ucar.nc2.constants.AxisType type,
java.lang.String prototype)
Returns a format to use for parsing values along the specified axis type. |
Methods inherited from class org.geotools.image.io.metadata.GeographicMetadata |
---|
addBand, createLoggedFormat, getAsTree, getBand, getGeometry, getLocale, getNumBands, getReferencing, getSampleType, isReadOnly, mergeTree, mergeTree, reset, setSampleType, toString, warningOccurred |
Methods inherited from class javax.imageio.metadata.IIOMetadata |
---|
activateController, getController, getDefaultController, getExtraMetadataFormatNames, getMetadataFormat, getMetadataFormatNames, getNativeMetadataFormatName, getStandardChromaNode, getStandardCompressionNode, getStandardDataNode, getStandardDimensionNode, getStandardDocumentNode, getStandardTextNode, getStandardTileNode, getStandardTransparencyNode, getStandardTree, hasController, isStandardMetadataFormatSupported, setController, setFromTree |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public NetcdfMetadata(javax.imageio.ImageReader reader, ucar.nc2.dataset.NetcdfDataset file)
CoordSysBuilder.addCoordinateSystems(ucar.nc2.dataset.NetcdfDataset, ucar.nc2.util.CancelTask)
should have been invoked
(if needed) before this constructor.
public NetcdfMetadata(javax.imageio.ImageReader reader, ucar.nc2.dataset.VariableDS variable)
CoordSysBuilder.addCoordinateSystems(ucar.nc2.dataset.NetcdfDataset, ucar.nc2.util.CancelTask)
should have been invoked
(if needed) before this constructor.
Method Detail |
---|
public void addCoordinateSystem(ucar.nc2.dataset.CoordinateSystem cs)
cs
- The coordinate system to add.public void addCoordinateAxis(ucar.nc2.dataset.CoordinateAxis axis)
addCoordinateSystem(ucar.nc2.dataset.CoordinateSystem)
.
axis
- The axis to add.public void addSampleDimension(ucar.nc2.dataset.VariableDS variable)
variable
- The variable to add as a sample dimension.protected java.text.Format getAxisFormat(ucar.nc2.constants.AxisType type, java.lang.String prototype)
DateFormat
using the
"yyyy-MM-dd HH:mm:ss"
pattern in UTC timezone.NumberFormat
.The Canada locale 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.
type
- The type of the axis.prototype
- An example of the values to be parsed. Implementations may parse this
prototype when the axis type alone is not suffisient. For example the time axis type should uses the "yyyy-MM-dd"
date pattern,
but some files do not follow this convention and use the default local instead.
protected boolean forcePacking(java.lang.String attribute)
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 EnhanceScaleMissing
):
Ifvalid_range
is the same type asscale_factor
(actually the wider ofscale_factor
andadd_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 returnsfalse
, then UCAR's heuristic rules applies.The default implementation returns
false
in all cases.
- Parameters:
attribute
- The attribute (usually"valid_range"
).- Returns:
true
if the attribute should be converted from unpacked to packed units regardless CF convention and UCAR's heuristic rules.- See Also:
EnhanceScaleMissing
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |