org.deegree.coverage.raster
Class SimpleRaster

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

public class SimpleRaster
extends AbstractRaster

This class represents a single raster with multiple bands.

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 SimpleRaster(Envelope envelope, RasterGeoReference rasterReference)
          Create a SimpleRaster with no raster data but with an envelope and raster envelope.
  SimpleRaster(RasterData raster, Envelope envelope, RasterGeoReference rasterReference)
          Creates a new SimpleRaster with given RasterData and Envelope
 
Method Summary
 SimpleRaster copy()
          Creates a copy of the raster with all the data.
 SimpleRaster createCompatibleSimpleRaster()
          Creates a new empty writable SimpleRaster with same size, DataType and InterleaveType.
 SimpleRaster createCompatibleSimpleRaster(BandType[] bands)
          Creates a SimpleRaster with same size, DataType and InterleaveType
 SimpleRaster createCompatibleSimpleRaster(RasterGeoReference rEnv, Envelope env)
          Creates a new empty SimpleRaster with same DataType and InterleaveType.
 void dispose()
          Cleans up all used memory buffers.
 SimpleRaster getAsSimpleRaster()
          Returns the AbstractRaster as a SimpleRaster.
 SimpleRaster getBand(int band)
          Returns a single band of the raster.
 int getBands()
           
 BandType[] getBandTypes()
           
 int getColumns()
          Returns columns of the raster.
 RasterData getRasterData()
          Returns the RasterData of this SimpleRaster
 RasterDataInfo getRasterDataInfo()
          Returns available information on the raster data.
 RasterData getReadOnlyRasterData()
          Returns a read-only copy of the RasterData of this SimpleRaster
 int getRows()
          Returns rows of the raster.
 SimpleRaster getSubRaster(double x, double y, double x2, double y2)
          Returns a subset of the raster.
 SimpleRaster getSubRaster(Envelope envelope)
          Returns a subset of the raster, note this is a view on the given raster.
 SimpleRaster getSubRaster(Envelope envelope, BandType[] bands)
          Returns a subset of the raster, note this is a view on the given raster.
 SimpleRaster getSubRaster(Envelope envelope, BandType[] bands, RasterGeoReference.OriginLocation targetLocation)
          Returns a subset of the raster, note this is a view on the given raster.
 boolean isSimpleRaster()
           
 void setSubRaster(double x, double y, AbstractRaster source)
          Sets the raster with data from source.
 void setSubRaster(double x, double y, int dstBand, AbstractRaster source)
          Sets a single band with data from source.
 void setSubRaster(Envelope env, AbstractRaster source)
          Sets the raster with data from source.
 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.raster.AbstractRaster
checkBounds, envelopeString, extendRasterReference, getAsRaster, getRasterReference, getResolutionInfo
 
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

SimpleRaster

protected SimpleRaster(Envelope envelope,
                       RasterGeoReference rasterReference)
Create a SimpleRaster with no raster data but with an envelope and raster envelope.

Parameters:
envelope - The envelope of the new raster.
rasterReference - The raster envelope of the new raster.

SimpleRaster

public SimpleRaster(RasterData raster,
                    Envelope envelope,
                    RasterGeoReference rasterReference)
Creates a new SimpleRaster with given RasterData and Envelope

Parameters:
raster - content for the SimpleRaster
envelope - The envelope of the new raster.
rasterReference - The raster envelope of the new raster.
Method Detail

createCompatibleSimpleRaster

public SimpleRaster createCompatibleSimpleRaster(BandType[] bands)
Creates a SimpleRaster with same size, DataType and InterleaveType

Parameters:
bands - number of bands
Returns:
new empty SimpleRaster

createCompatibleSimpleRaster

public SimpleRaster createCompatibleSimpleRaster()
Creates a new empty writable SimpleRaster with same size, DataType and InterleaveType.

Returns:
new empty SimpleRaster

createCompatibleSimpleRaster

public SimpleRaster createCompatibleSimpleRaster(RasterGeoReference rEnv,
                                                 Envelope env)
Creates a new empty SimpleRaster with same DataType and InterleaveType. Size is determined by the given envelope.

Parameters:
rEnv - The raster envelope of the new SimpleRaster.
env - The boundary of the new SimpleRaster.
Returns:
A new empty SimpleRaster.

copy

public SimpleRaster copy()
Description copied from class: AbstractRaster
Creates a copy of the raster with all the data.

Specified by:
copy in class AbstractRaster
Returns:
A copy of the raster.

getRasterData

public RasterData getRasterData()
Returns the RasterData of this SimpleRaster

Returns:
The raster data of this SimpleRaster.

getReadOnlyRasterData

public RasterData getReadOnlyRasterData()
Returns a read-only copy of the RasterData of this SimpleRaster

Returns:
The raster data of this SimpleRaster (read-only).

getSubRaster

public SimpleRaster getSubRaster(Envelope envelope)
Description copied from class: AbstractRaster
Returns a subset of the raster, note this is a view on the given raster.

Specified by:
getSubRaster in class AbstractRaster
Parameters:
envelope - envelope of the sub raster, may not be null
Returns:
subset of the raster

getSubRaster

public SimpleRaster getSubRaster(Envelope envelope,
                                 BandType[] bands)
Description copied from class: AbstractRaster
Returns a subset of the raster, note this is a view on the given raster.

Specified by:
getSubRaster in class AbstractRaster
Parameters:
envelope - 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 SimpleRaster getSubRaster(Envelope envelope,
                                 BandType[] bands,
                                 RasterGeoReference.OriginLocation targetLocation)
Description copied from class: AbstractRaster
Returns a subset of the raster, note this is a view on the given raster.

Specified by:
getSubRaster in class AbstractRaster
Parameters:
envelope - envelope of the sub raster
bands - to use for the given sub raster, if null the bands of the instance shall be used.
targetLocation - 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 SimpleRaster getSubRaster(double x,
                                 double y,
                                 double x2,
                                 double y2)
Description copied from class: AbstractRaster
Returns a subset of the raster.

Overrides:
getSubRaster in class AbstractRaster
Parameters:
x - left boundary
y - upper boundary
x2 - right boundary
y2 - lower boundary
Returns:
subset of the raster

getBand

public SimpleRaster getBand(int band)
Returns a single band of the raster.

Parameters:
band - Number of the selected band.
Returns:
A copy of the selected band.

setSubRaster

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

Specified by:
setSubRaster in class AbstractRaster
Parameters:
env - Envelope with the destination area
source - data to copy

setSubRaster

public void setSubRaster(double x,
                         double y,
                         AbstractRaster source)
Description copied from class: AbstractRaster
Sets the raster with data from source.

Specified by:
setSubRaster in class AbstractRaster
Parameters:
x - left boundary
y - upper boundary
source - data to copy

setSubRaster

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

Specified by:
setSubRaster in class AbstractRaster
Parameters:
x - left boundary
y - upper boundary
dstBand - selected destination band
source - data to copy

setSubRaster

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

Specified by:
setSubRaster in class AbstractRaster
Parameters:
env - destination area
dstBand - selected destination band
source - data to copy

getColumns

public int getColumns()
Description copied from class: AbstractRaster
Returns columns of the raster.

Overrides:
getColumns in class AbstractRaster
Returns:
width in pixel

getRows

public int getRows()
Description copied from class: AbstractRaster
Returns rows of the raster.

Overrides:
getRows in class AbstractRaster
Returns:
height in pixel

getBands

public int getBands()
Returns:
the number of bands in this raster.

getBandTypes

public BandType[] getBandTypes()
Returns:
the number of bands in this raster.

getRasterDataInfo

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

Specified by:
getRasterDataInfo in class AbstractRaster
Returns:
available information on the raster data.

getAsSimpleRaster

public SimpleRaster getAsSimpleRaster()
Description copied from class: AbstractRaster
Returns the AbstractRaster as a SimpleRaster. The data gets cropped (TiledRaster) or merged (MultiRange) if necessary.

Specified by:
getAsSimpleRaster in class AbstractRaster
Returns:
The raster data as SimpleRaster

toString

public String toString()
Overrides:
toString in class AbstractRaster

isSimpleRaster

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

dispose

public void dispose()
Cleans up all used memory buffers.



Copyright © 2011. All Rights Reserved.