appl.util
Class RasterMetaData

java.lang.Object
  extended by appl.util.RasterMetaData
All Implemented Interfaces:
Serializable

public final class RasterMetaData
extends Object
implements Serializable

Simple immutable class that encapsulates raster metadata, especially the MetaData of a WritableGrid. Just a constructor and getters on the fields.

Author:
Dominik Appl
See Also:
for details on the variable description, Serialized Form

Constructor Summary
RasterMetaData(int dataType, int gridWidth, int gridHeight, int minX, int minY, double x, double y, double cellSize, CoordinateReferenceSystem crs)
          Constructs a RasterMetaData Object.
RasterMetaData(int dataType, int gridWidth, int gridHeight, int minX, int minY, double x, double y, double realWidth, double realHeight, CoordinateReferenceSystem crs)
           
RasterMetaData(WritableGrid w)
          Constructs a RasterMetaDataObject out of the given Grid
 
Method Summary
 boolean equals(Object rasterMeta)
          Checks if the given RasterMetaData object has the same values.
 double getCellHeight()
           
 double getCellWidth()
           
 CoordinateReferenceSystem getCoordinateReferenceSystem()
           
 int getDataType()
           
 int getHeight()
           
 int getMinX()
           
 int getMinY()
           
 double getRealHeight()
           
 double getRealWidth()
           
 int getWidth()
           
 double getX()
           
 double getY()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RasterMetaData

public RasterMetaData(int dataType,
                      int gridWidth,
                      int gridHeight,
                      int minX,
                      int minY,
                      double x,
                      double y,
                      double realWidth,
                      double realHeight,
                      CoordinateReferenceSystem crs)
Parameters:
dataType - the datatype
gridWidth - the width of the grid (in cells)
gridHeight - the height of the grid (in cells)
minX - the minX (used to indicate a start index)
minY - the minY (used to indicate a start index)
realWidth - the real width
realHeight - the real height
x - the (geographic) x-coordinate
y - the (geographic) y-coordinate
crs - the CoordinateReferenceSystem. Use null for DefaultCRS (WGS84)
See Also:
WritableGrid

RasterMetaData

public RasterMetaData(int dataType,
                      int gridWidth,
                      int gridHeight,
                      int minX,
                      int minY,
                      double x,
                      double y,
                      double cellSize,
                      CoordinateReferenceSystem crs)
Constructs a RasterMetaData Object. The values of the real height/ width are calculated out of the cellsize. The cells are assumed to be squares.

Parameters:
dataType - the datatype
gridWidth - the width of the grid (in cells)
gridHeight - the height of the grid (in cells)
minX - the minX (used to indicate a start index)
minY - the minY (used to indicate a start index)
x - the (geographic) x-coordinate
y - the (geographic) y-coordinate
cellSize - the real size of one cell
crs - the CoordinateReferenceSystem, use null for default CRS (WGS84)

RasterMetaData

public RasterMetaData(WritableGrid w)
Constructs a RasterMetaDataObject out of the given Grid

Parameters:
w - the source grid
Method Detail

getCoordinateReferenceSystem

public final CoordinateReferenceSystem getCoordinateReferenceSystem()
Returns:
Returns the CRS of the raster

getHeight

public final int getHeight()
Returns:
Returns the height in cells

getWidth

public final int getWidth()
Returns:
Returns the width in cells.

getDataType

public final int getDataType()
Returns:
Returns the dataType.

getMinX

public final int getMinX()
Returns:
Returns minX (used to indicate a start index)
See Also:
ReadableGrid.getMinX()

getMinY

public final int getMinY()
Returns:
Returns the minY ((used to indicate a start index)
See Also:
ReadableGrid.getMinY()

getRealHeight

public final double getRealHeight()
Returns:
Returns the realHeight.

getRealWidth

public final double getRealWidth()
Returns:
Returns the realWidth.

getX

public final double getX()
Returns:
Returns the (geographic) x-coordinate

getY

public final double getY()
Returns:
Returns the (geographic) y-coordinate

getCellWidth

public final double getCellWidth()
Returns:
the real width of a raster cell

equals

public boolean equals(Object rasterMeta)
Checks if the given RasterMetaData object has the same values.

Overrides:
equals in class Object
Parameters:
rasterMeta - must be a RasterMetaDataObject! Else ClassCastException will be thrown.
Returns:
true, if all values are the same
See Also:
Object.equals(java.lang.Object)

getCellHeight

public final double getCellHeight()
Returns:
the real height of a raster cell

toString

public final String toString()
Overrides:
toString in class Object