|
||||||||||
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
public class GeographicMetadata
Geographic informations encoded in image as metadata. This class provides various methods for
reading and writting attribute values in IIOMetadataNode
according the geographic metadata format. If some inconsistency are found while
reading (for example if the coordinate system dimension doesn't match the envelope dimension),
then the default implementation logs a warning. 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 warningOccurred(java.util.logging.LogRecord)
method, subclasses can override this method if they want
treat some warnings as fatal errors.
Field Summary |
---|
Fields inherited from class javax.imageio.metadata.IIOMetadata |
---|
controller, defaultController, extraMetadataFormatClassNames, extraMetadataFormatNames, nativeMetadataFormatClassName, nativeMetadataFormatName, standardFormatSupported |
Constructor Summary | |
---|---|
GeographicMetadata()
Creates a default metadata instance. |
|
GeographicMetadata(boolean standardMetadataFormatSupported,
java.lang.String nativeMetadataFormatName,
java.lang.String nativeMetadataFormatClassName,
java.lang.String[] extraMetadataFormatNames,
java.lang.String[] extraMetadataFormatClassNames)
Constructs a geographic metadata instance with the given format names and format class names. |
|
GeographicMetadata(javax.imageio.ImageReader reader)
Creates a default metadata instance for the given reader. |
|
GeographicMetadata(javax.imageio.ImageWriter writer)
Creates a default metadata instance for the given writer. |
Method Summary | ||
---|---|---|
Band |
addBand(java.lang.String name)
Creates a new band and returns it. |
|
protected
|
createLoggedFormat(java.text.Format format,
java.lang.Class<T> type)
Wraps the specified format in order to either parse fully a string, or log a warning. |
|
org.w3c.dom.Node |
getAsTree(java.lang.String formatName)
Returns the root of a tree of metadata contained within this object according to the conventions defined by a given metadata format. |
|
Band |
getBand(int bandIndex)
Returns the band at the specified index. |
|
ImageGeometry |
getGeometry()
Returns the grid geometry. |
|
java.util.Locale |
getLocale()
Returns the language to use when logging a warning, or null if none has been set. |
|
int |
getNumBands()
Returns the number of bands in the coverage. |
|
ImageReferencing |
getReferencing()
Returns the grid referencing. |
|
java.lang.String |
getSampleType()
Returns the sample type (typically or ), or null if none. |
|
boolean |
isReadOnly()
Returns false since this node support some write operations. |
|
void |
mergeTree(javax.imageio.metadata.IIOMetadata metadata)
Alters the internal state of this metadata from a tree defined by the specified metadata. |
|
void |
mergeTree(java.lang.String formatName,
org.w3c.dom.Node root)
Alters the internal state of this metadata from a tree whose syntax is defined by the given metadata format. |
|
void |
reset()
Resets all the data stored in this object to default values. |
|
void |
setSampleType(java.lang.String type)
Set the sample type for all bands. |
|
java.lang.String |
toString()
Returns a string representation of this metadata, mostly for debugging purpose. |
|
protected void |
warningOccurred(java.util.logging.LogRecord record)
Invoked when a warning occured. |
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 GeographicMetadata()
public GeographicMetadata(javax.imageio.ImageReader reader)
reader
- The source image reader, or null
if none.public GeographicMetadata(javax.imageio.ImageWriter writer)
writer
- The target image writer, or null
if none.public GeographicMetadata(boolean standardMetadataFormatSupported, java.lang.String nativeMetadataFormatName, java.lang.String nativeMetadataFormatClassName, java.lang.String[] extraMetadataFormatNames, java.lang.String[] extraMetadataFormatClassNames)
standardMetadataFormatSupported
- true
if this object can return or accept
a DOM tree using the standard metadata format.nativeMetadataFormatName
- The name of the native metadata, or null
if none.nativeMetadataFormatClassName
- The name of the class of the native metadata format,
or null
if none.extraMetadataFormatNames
- Additional formats supported by this object,
or null
if none.extraMetadataFormatClassNames
- The class names of any additional formats
supported by this object, or null
if none.Method Detail |
---|
public boolean isReadOnly()
false
since this node support some write operations.
isReadOnly
in class javax.imageio.metadata.IIOMetadata
public ImageReferencing getReferencing()
public ImageGeometry getGeometry()
public java.lang.String getSampleType()
null
if none. This type applies
to all bands.
public void setSampleType(java.lang.String type)
type
- The sample type, or null
if none.public int getNumBands()
public Band getBand(int bandIndex) throws java.lang.IndexOutOfBoundsException
bandIndex
- the band index, ranging from 0 inclusive to getNumBands()
exclusive.
java.lang.IndexOutOfBoundsException
- if the index is out of bounds.public Band addBand(java.lang.String name)
name
- The name for the new band.public org.w3c.dom.Node getAsTree(java.lang.String formatName) throws java.lang.IllegalArgumentException
getAsTree
in class javax.imageio.metadata.IIOMetadata
formatName
- the desired metadata format.
java.lang.IllegalArgumentException
- if the format name is null
or is not
one of the names returned by IIOMetadata.getMetadataFormatNames()
.public void mergeTree(java.lang.String formatName, org.w3c.dom.Node root) throws javax.imageio.metadata.IIOInvalidTreeException
mergeTree
in class javax.imageio.metadata.IIOMetadata
formatName
- The desired metadata format.root
- An XML DOM Node object forming the root of a tree.
javax.imageio.metadata.IIOInvalidTreeException
public void mergeTree(javax.imageio.metadata.IIOMetadata metadata) throws javax.imageio.metadata.IIOInvalidTreeException
metadata
- The metadata to merge to this object.
javax.imageio.metadata.IIOInvalidTreeException
- If the metadata can not be merged.public void reset()
reset
in class javax.imageio.metadata.IIOMetadata
public java.util.Locale getLocale()
null
if none has been set. The default implementation delegates to
ImageReader.getLocale()
or ImageWriter.getLocale()
if possible, or
returns null
otherwise.
protected void warningOccurred(java.util.logging.LogRecord record)
GeographicImageReader.warningOccurred(java.util.logging.LogRecord)
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.
protected <T> LoggedFormat<T> createLoggedFormat(java.text.Format format, java.lang.Class<T> type)
format
- The format to use for parsing and formatting.type
- The expected type of parsed values.public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |