org.deegree.coverage.raster
Class AbstractRaster

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

public abstract class AbstractRaster
extends AbstractCoverage

This class represents an abstract grid coverage.

Version:
$Revision: 31644 $, $Date: 2011-08-24 22:27:43 +0200 (Wed, 24 Aug 2011) $
Author:
Oliver Tonnhofer, last edited by: $Author: mschneider $

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.
 AbstractRaster getAsRaster(Envelope spatialExtent, SampleResolution resolution, InterpolationType interpolation)
          Get a rasterized extent of this coverage by applying the given sample resolution to the given spatial extent of the coverage and applying the given interpolation if needed.
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()
           
 ResolutionInfo getResolutionInfo()
          Returns information about the possible sample resolutions of this coverage.
 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 subsetEnv)
          Returns a subset of the raster, note this is a view on the given raster.
abstract  AbstractRaster getSubRaster(Envelope subsetEnv, BandType[] bands)
          Returns a subset of the raster, note this is a view on the given raster.
abstract  AbstractRaster getSubRaster(Envelope subsetEnv, BandType[] bands, RasterGeoReference.OriginLocation targetOrigin)
          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
destroy, extendEnvelope, getCoordinateSystem, getEnvelope, getGeometryFactory, getLabel, getName, getSupplementProperties, init, 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 subsetEnv)
Returns a subset of the raster, note this is a view on the given raster.

Parameters:
subsetEnv - envelope of the sub raster, may not be null
Returns:
subset of the raster

getSubRaster

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

Parameters:
subsetEnv - envelope of the sub raster, may not be null
bands - to use for the given sub raster, if null the bands of the instance shall be used.
Returns:
subset of the raster

getSubRaster

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

Parameters:
subsetEnv - envelope of the sub raster
bands - to use for the given sub raster, if null the bands of the instance shall be used.
targetOrigin - the origin location of the target sub raster, if null the origin location of the instance shall be used.
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.

getAsRaster

public AbstractRaster getAsRaster(Envelope spatialExtent,
                                  SampleResolution resolution,
                                  InterpolationType interpolation)
Description copied from interface: Coverage
Get a rasterized extent of this coverage by applying the given sample resolution to the given spatial extent of the coverage and applying the given interpolation if needed. Note this method also should support srs transformations.

Parameters:
spatialExtent - the area of interest of resulting raster
resolution - the resolution to use for sampling the given extent.
interpolation - the interpolation to use, if the resolution does not match the 'native' resolution of the coverage.
Returns:
a rasterized extent of this coverage.

getResolutionInfo

public ResolutionInfo getResolutionInfo()
Returns information about the possible sample resolutions of this coverage.

Returns:
information about the possible sample resolutions.


Copyright © 2011. All Rights Reserved.