deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official

org.deegree.coverage.raster
Class AbstractRaster

java.lang.Object
  extended by org.deegree.coverage.AbstractCoverage
      extended by org.deegree.coverage.raster.AbstractRaster
Direct Known Subclasses:
MultiRangedRaster, SimpleRaster, TiledRaster

public abstract class AbstractRaster
extends AbstractCoverage

This class represents an abstract grid coverage.

Version:
$Revision: 21493 $, $Date: 2009-12-16 14:07:51 +0100 (Mi, 16 Dez 2009) $
Author:
Oliver Tonnhofer, last edited by: $Author: rbezema $

Constructor Summary
protected AbstractRaster()
          Instantiate an AbstractRaster with no envelope.
protected AbstractRaster(Envelope envelope)
          Instantiate an AbstractRaster with given envelope.
protected AbstractRaster(Envelope envelope, RasterGeoReference rasterReference)
          Instantiate an AbstractRaster with given envelope and raster envelope.
 
Method Summary
protected  void checkBounds(Envelope envelope)
          Checks if the coverage contains the envelope.
abstract  AbstractRaster copy()
          Creates a copy of the raster with all the data.
protected  String envelopeString()
           
protected  void extendRasterReference(RasterGeoReference rasterReference)
          Extends current RasterReference with rasterReference.
abstract  SimpleRaster getAsSimpleRaster()
          Returns the AbstractRaster as a SimpleRaster.
 int getColumns()
          Returns columns of the raster.
abstract  RasterDataInfo getRasterDataInfo()
          Returns available information on the raster data.
 RasterGeoReference getRasterReference()
           
 int getRows()
          Returns rows of the raster.
 AbstractRaster getSubRaster(double x, double y, double x2, double y2)
          Returns a subset of the raster.
abstract  AbstractRaster getSubRaster(Envelope env)
          Returns a subset of the raster, note this is a view on the given raster.
abstract  AbstractRaster getSubRaster(Envelope env, BandType[] bands)
          Returns a subset of the raster, note this is a view on the given raster.
 boolean isSimpleRaster()
           
abstract  void setSubRaster(double x, double y, AbstractRaster source)
          Sets the raster with data from source.
abstract  void setSubRaster(double x, double y, int dstBand, AbstractRaster source)
          Sets a single band with data from source.
abstract  void setSubRaster(Envelope env, AbstractRaster source)
          Sets the raster with data from source.
abstract  void setSubRaster(Envelope env, int dstBand, AbstractRaster source)
          Sets a single band with data from source.
 String toString()
           
 
Methods inherited from class org.deegree.coverage.AbstractCoverage
extendEnvelope, getCoordinateSystem, getEnvelope, getGeometryFactory, getLabel, getName, getSupplementProperties, setCoordinateSystem, setEnvelope, setLabel, setName, setSupplementProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractRaster

protected AbstractRaster()
Instantiate an AbstractRaster with no envelope.


AbstractRaster

protected AbstractRaster(Envelope envelope)
Instantiate an AbstractRaster with given envelope.

Parameters:
envelope - The envelope of the raster.

AbstractRaster

protected AbstractRaster(Envelope envelope,
                         RasterGeoReference rasterReference)
Instantiate an AbstractRaster with given envelope and raster envelope.

Parameters:
envelope - The envelope of the raster.
rasterReference - The raster reference of the underlying raster.
Method Detail

getColumns

public int getColumns()
Returns columns of the raster.

Returns:
width in pixel

getRows

public int getRows()
Returns rows of the raster.

Returns:
height in pixel

extendRasterReference

protected void extendRasterReference(RasterGeoReference rasterReference)
Extends current RasterReference with rasterReference. Useful for extending the raster, e.g. adding a tile.

Parameters:
rasterReference - The raster envelope to add to the current.

checkBounds

protected void checkBounds(Envelope envelope)
Checks if the coverage contains the envelope.

Parameters:
envelope - The envelope to check for.

copy

public abstract AbstractRaster copy()
Creates a copy of the raster with all the data.

Returns:
A copy of the raster.

getSubRaster

public abstract AbstractRaster getSubRaster(Envelope env)
Returns a subset of the raster, note this is a view on the given raster.

Parameters:
env - envelope of the subset
Returns:
subset of the raster

getSubRaster

public abstract AbstractRaster getSubRaster(Envelope env,
                                            BandType[] bands)
Returns a subset of the raster, note this is a view on the given raster.

Parameters:
env - envelope of the subset
bands - to use for the given subset.
Returns:
subset of the raster

getSubRaster

public AbstractRaster getSubRaster(double x,
                                   double y,
                                   double x2,
                                   double y2)
Returns a subset of the raster.

Parameters:
x - left boundary
y - upper boundary
x2 - right boundary
y2 - lower boundary
Returns:
subset of the raster

setSubRaster

public abstract void setSubRaster(Envelope env,
                                  AbstractRaster source)
Sets the raster with data from source. Source must overlap the raster (within the envelope).

Parameters:
source - data to copy
env - Envelope with the destination area

setSubRaster

public abstract void setSubRaster(double x,
                                  double y,
                                  AbstractRaster source)
Sets the raster with data from source.

Parameters:
x - left boundary
y - upper boundary
source - data to copy

setSubRaster

public abstract void setSubRaster(double x,
                                  double y,
                                  int dstBand,
                                  AbstractRaster source)
Sets a single band with data from source. Copies the first band of source into dstBand.

Parameters:
x - left boundary
y - upper boundary
dstBand - selected destination band
source - data to copy

setSubRaster

public abstract void setSubRaster(Envelope env,
                                  int dstBand,
                                  AbstractRaster source)
Sets a single band with data from source.

Parameters:
env - destination area
dstBand - selected destination band
source - data to copy

getAsSimpleRaster

public abstract SimpleRaster getAsSimpleRaster()
Returns the AbstractRaster as a SimpleRaster. The data gets cropped (TiledRaster) or merged (MultiRange) if necessary.

Returns:
The raster data as SimpleRaster

toString

public String toString()
Overrides:
toString in class Object

envelopeString

protected String envelopeString()
Returns:
string representation of the envelope

getRasterReference

public RasterGeoReference getRasterReference()
Returns:
The raster reference of this raster.

getRasterDataInfo

public abstract RasterDataInfo getRasterDataInfo()
Returns available information on the raster data. This method should be called with care, it may under circumstances, cause massive loading of raster data.

Returns:
available information on the raster data.

isSimpleRaster

public boolean isSimpleRaster()
Returns:
true if the given raster is a simple raster, false otherwise.

deegree-core-3.0-pre-nightly (2010/03/05 00:01) - official

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org

]]>