| java.lang.Object javax.imageio.metadata.IIOMetadata org.geotools.image.io.metadata.GeographicMetadata
All known Subclasses: org.geotools.image.io.netcdf.NetcdfMetadata,
GeographicMetadata | public class GeographicMetadata extends IIOMetadata (Code) | | Geographic informations encoded in image as metadata. This class provides various methods for
reading and writting attribute values in
IIOMetadataNode according the
. If some inconsistency are found while
reading (for example if the coordinate system dimension doesn't match the envelope dimension),
then the default implementation
. We do not throw
an exception because minor errors are not uncommon in geographic data, and we want to process
the data on a "best effort" basis. However because every warnings are logged
through the
GeographicMetadata.warningOccurred method, subclasses can override this method if they want
treat some warnings as fatal errors.
since: 2.4 version: $Id: GeographicMetadata.java 27862 2007-11-12 19:51:19Z desruisseaux $ author: Martin Desruisseaux |
Constructor Summary | |
public | GeographicMetadata() Creates a default metadata instance. | public | GeographicMetadata(ImageReader reader) Creates a default metadata instance for the given reader. | public | GeographicMetadata(ImageWriter writer) Creates a default metadata instance for the given writer. | public | GeographicMetadata(boolean standardMetadataFormatSupported, String nativeMetadataFormatName, String nativeMetadataFormatClassName, String[] extraMetadataFormatNames, String[] extraMetadataFormatClassNames) Constructs a geographic metadata instance with the given format names and format class names. |
Method Summary | |
public Band | addBand(String name) Creates a new band and returns it. | protected LoggedFormat | createLoggedFormat(Format format, Class type) Wraps the specified format in order to either parse fully a string, or log a warning. | final LoggedFormat | dateFormat() Returns a standard date format to be shared by
MetadataAccessor . | public Node | getAsTree(String formatName) Returns the root of a tree of metadata contained within this object
according to the conventions defined by a given metadata format.
Parameters: formatName - the desired metadata format. | public Band | getBand(int bandIndex) Returns the band at the specified index. | final ChildList | getBands() Returns the list of all
. | public ImageGeometry | getGeometry() Returns the grid geometry. | public Locale | getLocale() Returns the language to use when
,
or
null if none has been set. | public int | getNumBands() Returns the number of
in the coverage. | public ImageReferencing | getReferencing() Returns the grid referencing. | final Node | getRootNode() Returns the root of a tree of metadata contained within this object
according to the conventions defined by a given metadata format. | public String | getSampleType() Returns the sample type (typically
or
), or
null if none. | public boolean | isReadOnly() Returns
false since this node support some write operations. | public void | mergeTree(String formatName, Node root) Alters the internal state of this metadata from a tree whose syntax is defined by
the given metadata format. | public void | mergeTree(IIOMetadata metadata) Alters the internal state of this metadata from a tree defined by the specified metadata. | public void | reset() Resets all the data stored in this object to default values. | public void | setSampleType(String type) Set the sample type for all
. | public String | toString() Returns a string representation of this metadata, mostly for debugging purpose. | protected void | warningOccurred(LogRecord record) Invoked when a warning occured. |
GeographicMetadata | public GeographicMetadata()(Code) | | Creates a default metadata instance. This constructor defines no standard or native format.
The only format defined is the
one.
|
GeographicMetadata | public GeographicMetadata(ImageReader reader)(Code) | | Creates a default metadata instance for the given reader.
Parameters: reader - The source image reader, or null if none. |
GeographicMetadata | public GeographicMetadata(ImageWriter writer)(Code) | | Creates a default metadata instance for the given writer.
Parameters: writer - The target image writer, or null if none. |
GeographicMetadata | public GeographicMetadata(boolean standardMetadataFormatSupported, String nativeMetadataFormatName, String nativeMetadataFormatClassName, String[] extraMetadataFormatNames, String[] extraMetadataFormatClassNames)(Code) | | Constructs a geographic metadata instance with the given format names and format class names.
This constructor passes the arguments to the
unchanged.
Parameters: standardMetadataFormatSupported - true if this object can return or accepta DOM tree using the standard metadata format. Parameters: nativeMetadataFormatName - The name of the native metadata, or null if none. Parameters: nativeMetadataFormatClassName - The name of the class of the native metadata format,or null if none. Parameters: extraMetadataFormatNames - Additional formats supported by this object,or null if none. Parameters: extraMetadataFormatClassNames - The class names of any additional formatssupported by this object, or null if none. |
addBand | public Band addBand(String name)(Code) | | Creates a new band and returns it.
Parameters: name - The name for the new band. |
createLoggedFormat | protected LoggedFormat createLoggedFormat(Format format, Class type)(Code) | | Wraps the specified format in order to either parse fully a string, or log a warning.
Parameters: format - The format to use for parsing and formatting. Parameters: type - The expected type of parsed values. |
getNumBands | public int getNumBands()(Code) | | Returns the number of
in the coverage.
|
getRootNode | final Node getRootNode()(Code) | | Returns the root of a tree of metadata contained within this object
according to the conventions defined by a given metadata format.
|
getSampleType | public String getSampleType()(Code) | | Returns the sample type (typically
or
), or
null if none. This type applies
to all
.
|
isReadOnly | public boolean isReadOnly()(Code) | | Returns
false since this node support some write operations.
|
mergeTree | public void mergeTree(String formatName, Node root) throws IIOInvalidTreeException(Code) | | Alters the internal state of this metadata from a tree whose syntax is defined by
the given metadata format. The default implementation simply replaces all existing
state with the contents of the given tree.
Parameters: formatName - The desired metadata format. Parameters: root - An XML DOM Node object forming the root of a tree. |
mergeTree | public void mergeTree(IIOMetadata metadata) throws IIOInvalidTreeException(Code) | | Alters the internal state of this metadata from a tree defined by the specified metadata.
The default implementation expect the
format.
Parameters: metadata - The metadata to merge to this object. |
reset | public void reset()(Code) | | Resets all the data stored in this object to default values.
|
setSampleType | public void setSampleType(String type)(Code) | | Set the sample type for all
. Valid types include
and
.
Parameters: type - The sample type, or null if none. |
toString | public String toString()(Code) | | Returns a string representation of this metadata, mostly for debugging purpose.
|
warningOccurred | protected void warningOccurred(LogRecord record)(Code) | | Invoked when a warning occured. This method is invoked when some inconsistency has
been detected in the geographic metadata. The default implementation delegates to
GeographicImageReader.warningOccurred if possible, or send the record to
the
"org.geotools.image.io.metadata" logger otherwise.
Subclasses may override this method if more processing is wanted, or for
throwing exception if some warnings should be considered as fatal errors.
|
|
|