it.geosolutions.imageio.core
Class CoreCommonImageMetadata

Object
  extended by IIOMetadata
      extended by CoreCommonImageMetadata
Direct Known Subclasses:
BaseImageMetadata, GDALCommonIIOImageMetadata

public abstract class CoreCommonImageMetadata
extends IIOMetadata

Class needed to store all available information of a 2D Dataset with the add of additional information. For convenience and future re-use this class also represents an IIOMetadata. A wide set of getters method allow to retrieve several information directly from the metadata instance, without need of getting the XML DOM nodes tree.

Author:
Simone Giannecchini, GeoSolutions., Daniele Romagnoli, GeoSolutions.

Field Summary
static String nativeMetadataFormatClassName
          The name of the class implementing IIOMetadataFormat and representing the native metadata format for this object.
static String nativeMetadataFormatName
          The name of the native metadata format for this object.
 
Fields inherited from class IIOMetadata
controller, defaultController, extraMetadataFormatClassNames, extraMetadataFormatNames, standardFormatSupported
 
Constructor Summary
protected CoreCommonImageMetadata(boolean standardMetadataFormatSupported, String nativeMetadataFormatName, String nativeMetadataFormatClassName, String[] extraMetadataFormatNames, String[] extraMetadataFormatClassNames)
          Private constructor
 
Method Summary
protected  Node createCommonNativeTree()
          Returns the XML DOM Node object that represents the root of a tree of metadata contained within this object on its native format.
 Node getAsTree(String formatName)
          Returns an XML DOM Node object that represents the root of a tree of common stream metadata contained within this object according to the conventions defined by a given metadata format name.
protected  int[] getColorInterpretations()
           
 int getColorInterpretations(int bandIndex)
          Returns the colorInterpretation for the specified band
 ColorModel getColorModel()
          Returns the ColorModel for the dataset held by this object.
 String getDatasetDescription()
           
 String getDatasetName()
          Returns the name of the dataset which is the source for this IIOMetadata
 String getDescription()
          Returns the description of the dataset which is the source for this IIOMetadata
 String getDriverDescription()
          Returns the description of the GDAL driver used to open the source dataset for this IIOMetadata
 String getDriverName()
          Returns the name of the GDAL driver used to open the source dataset for this IIOMetadata
 int getGcpNumber()
          Returns the number of Ground Control Points
 String getGcpProjection()
          Returns the Ground Control Point's projection
 List<? extends GCP> getGCPs()
          Returns the Ground Control Points
 double[] getGeoTransformation()
          Returns the grid to world transformation of the image
 int getHeight()
          Returns the height of the image
 double getMaximum(int bandIndex)
          Returns the maximum value for the specified band
 Double[] getMaximums()
           
 double getMinimum(int bandIndex)
          Returns the minimum value for the specified band
 Double[] getMinimums()
           
 double getNoDataValue(int bandIndex)
          Returns the noDataValue value for the specified band
 Double[] getNoDataValues()
           
 int getNumBands()
          Returns the number of bands of the dataset which is the source for this IIOMetadata
 int[] getNumOverviews()
           
 int getNumOverviews(int bandIndex)
          Returns the number of overviews for the specified band
 double getOffset(int bandIndex)
          Returns the offset value for the specified band
 Double[] getOffsets()
           
 String getProjection()
          Returns the projection
 SampleModel getSampleModel()
          Returns the SampleModel for the dataset held by this object.
 double getScale(int bandIndex)
          Returns the scale value for the specified band
 Double[] getScales()
           
 int getTileHeight()
          Returns the tile height of the image
 int getTileWidth()
          Returns the tile width of the image
 int getWidth()
          Returns the width of the image
 boolean isReadOnly()
          Returns true since this object does not support the mergeTree, setFromTree, and reset methods.
 void mergeTree(String formatName, Node root)
          Method unsupported.
 void reset()
          Method unsupported.
protected  void setColorInterpretations(int[] colorInterpretations)
           
protected  void setColorModel(ColorModel colorModel)
           
protected  void setDatasetDescription(String datasetDescription)
           
protected  void setDatasetName(String datasetName)
           
protected  void setDriverDescription(String driverDescription)
           
protected  void setDriverName(String driverName)
           
protected  void setGcpNumber(int gcpNumber)
           
protected  void setGcpProjection(String gcpProjection)
           
protected  void setGcps(List<GCP> gcps)
           
protected  void setGeoTransformation(double[] geoTransformation)
           
protected  void setHeight(int height)
           
protected  void setMaximums(Double[] maximums)
           
protected  void setMinimums(Double[] minimums)
           
protected  void setNoDataValues(Double[] noDataValues)
           
protected  void setNumBands(int numBands)
           
protected  void setNumOverviews(int[] numOverviews)
           
protected  void setOffsets(Double[] offsets)
           
protected  void setProjection(String projection)
           
protected  void setSampleModel(SampleModel sampleModel)
           
protected  void setScales(Double[] scales)
           
protected  void setTileHeight(int tileHeight)
           
protected  void setTileWidth(int tileWidth)
           
protected  void setWidth(int width)
           
 
Methods inherited from class 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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nativeMetadataFormatName

public static final String nativeMetadataFormatName
The name of the native metadata format for this object.

See Also:
Constant Field Values

nativeMetadataFormatClassName

public static final String nativeMetadataFormatClassName
The name of the class implementing IIOMetadataFormat and representing the native metadata format for this object.

See Also:
Constant Field Values
Constructor Detail

CoreCommonImageMetadata

protected CoreCommonImageMetadata(boolean standardMetadataFormatSupported,
                                  String nativeMetadataFormatName,
                                  String nativeMetadataFormatClassName,
                                  String[] extraMetadataFormatNames,
                                  String[] extraMetadataFormatClassNames)
Private constructor

Method Detail

createCommonNativeTree

protected Node createCommonNativeTree()
Returns the XML DOM Node object that represents the root of a tree of metadata contained within this object on its native format.

Returns:
a root node containing common metadata exposed on its native format.

getAsTree

public Node getAsTree(String formatName)
Returns an XML DOM Node object that represents the root of a tree of common stream metadata contained within this object according to the conventions defined by a given metadata format name.

Specified by:
getAsTree in class IIOMetadata
Parameters:
formatName - the name of the requested metadata format. Note that actually, the only supported format name is the nativeMetadataFormatName. Requesting other format names will result in an IllegalArgumentException

isReadOnly

public boolean isReadOnly()
Returns true since this object does not support the mergeTree, setFromTree, and reset methods.

Specified by:
isReadOnly in class IIOMetadata
Returns:
true since this IIOMetadata object cannot be modified.

mergeTree

public void mergeTree(String formatName,
                      Node root)
               throws IIOInvalidTreeException
Method unsupported. Calling this method will throws an UnsupportedOperationException

Specified by:
mergeTree in class IIOMetadata
Throws:
IIOInvalidTreeException
See Also:
javax.imageio.metadata.IIOMetadata#mergeTree(), isReadOnly()

reset

public void reset()
Method unsupported. Calling this method will throws an UnsupportedOperationException

Specified by:
reset in class IIOMetadata
See Also:
IIOMetadata.reset(), isReadOnly()

getDatasetName

public String getDatasetName()
Returns the name of the dataset which is the source for this IIOMetadata


getDescription

public String getDescription()
Returns the description of the dataset which is the source for this IIOMetadata


getDriverName

public String getDriverName()
Returns the name of the GDAL driver used to open the source dataset for this IIOMetadata


getDriverDescription

public String getDriverDescription()
Returns the description of the GDAL driver used to open the source dataset for this IIOMetadata


getNumBands

public int getNumBands()
Returns the number of bands of the dataset which is the source for this IIOMetadata


getWidth

public int getWidth()
Returns the width of the image


getHeight

public int getHeight()
Returns the height of the image


getTileHeight

public int getTileHeight()
Returns the tile height of the image


getTileWidth

public int getTileWidth()
Returns the tile width of the image


getColorModel

public ColorModel getColorModel()
Returns the ColorModel for the dataset held by this object.


getSampleModel

public SampleModel getSampleModel()
Returns the SampleModel for the dataset held by this object.


getProjection

public String getProjection()
Returns the projection


setGcps

protected void setGcps(List<GCP> gcps)

getGeoTransformation

public double[] getGeoTransformation()
Returns the grid to world transformation of the image


getGcpNumber

public int getGcpNumber()
Returns the number of Ground Control Points


getGcpProjection

public String getGcpProjection()
Returns the Ground Control Point's projection


getGCPs

public List<? extends GCP> getGCPs()
Returns the Ground Control Points


getMaximums

public Double[] getMaximums()

setMaximums

protected void setMaximums(Double[] maximums)

getMinimums

public Double[] getMinimums()

setMinimums

protected void setMinimums(Double[] minimums)

getNoDataValues

public Double[] getNoDataValues()

setNoDataValues

protected void setNoDataValues(Double[] noDataValues)

getScales

public Double[] getScales()

setScales

protected void setScales(Double[] scales)

getOffsets

public Double[] getOffsets()

setOffsets

protected void setOffsets(Double[] offsets)

getNumOverviews

public int[] getNumOverviews()

setNumOverviews

protected void setNumOverviews(int[] numOverviews)

getNumOverviews

public int getNumOverviews(int bandIndex)
Returns the number of overviews for the specified band

Parameters:
bandIndex - the index of the required band
Throws:
IllegalArgumentException - in case the specified band number is out of range

getColorInterpretations

public int getColorInterpretations(int bandIndex)
Returns the colorInterpretation for the specified band

Parameters:
bandIndex - the index of the required band
Throws:
IllegalArgumentException - in case the specified band number is out of range

getMaximum

public double getMaximum(int bandIndex)
                  throws IllegalArgumentException
Returns the maximum value for the specified band

Parameters:
bandIndex - the index of the required band
Throws:
IllegalArgumentException - in case the specified band number is out of range or maximum value has not been found

getMinimum

public double getMinimum(int bandIndex)
                  throws IllegalArgumentException
Returns the minimum value for the specified band

Parameters:
bandIndex - the index of the required band
Throws:
IllegalArgumentException - in case the specified band number is out of range or minimum value has not been found

getScale

public double getScale(int bandIndex)
                throws IllegalArgumentException
Returns the scale value for the specified band

Parameters:
bandIndex - the index of the required band
Throws:
IllegalArgumentException - in case the specified band number is out of range or scale value has not been found

getOffset

public double getOffset(int bandIndex)
                 throws IllegalArgumentException
Returns the offset value for the specified band

Parameters:
bandIndex - the index of the required band
Throws:
IllegalArgumentException - in case the specified band number is out of range or offset value has not been found

getNoDataValue

public double getNoDataValue(int bandIndex)
                      throws IllegalArgumentException
Returns the noDataValue value for the specified band

Parameters:
bandIndex - the index of the required band
Throws:
IllegalArgumentException - in case the specified band number is out of range or noDataValue has not been found

getDatasetDescription

public String getDatasetDescription()

setDatasetDescription

protected void setDatasetDescription(String datasetDescription)

setDriverName

protected void setDriverName(String driverName)

setDriverDescription

protected void setDriverDescription(String driverDescription)

setDatasetName

protected void setDatasetName(String datasetName)

setProjection

protected void setProjection(String projection)

setGcpNumber

protected void setGcpNumber(int gcpNumber)

setGcpProjection

protected void setGcpProjection(String gcpProjection)

setWidth

protected void setWidth(int width)

setHeight

protected void setHeight(int height)

setTileHeight

protected void setTileHeight(int tileHeight)

setTileWidth

protected void setTileWidth(int tileWidth)

setColorModel

protected void setColorModel(ColorModel colorModel)

setSampleModel

protected void setSampleModel(SampleModel sampleModel)

setNumBands

protected void setNumBands(int numBands)

setGeoTransformation

protected void setGeoTransformation(double[] geoTransformation)

getColorInterpretations

protected int[] getColorInterpretations()

setColorInterpretations

protected void setColorInterpretations(int[] colorInterpretations)


Copyright © 2006-2010 GeoSolutions. All Rights Reserved.