org.deegree.coverage.raster
Class MultiResolutionRaster

java.lang.Object
  extended by org.deegree.coverage.AbstractCoverage
      extended by org.deegree.coverage.raster.MultiResolutionRaster
All Implemented Interfaces:
Resource, Coverage

public class MultiResolutionRaster
extends AbstractCoverage

This class represents a collection of AbstractRaster instances that describe the same spatial region, but with different resolutions.

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
MultiResolutionRaster()
          Create an empty multi resolution raster.
 
Method Summary
 void addRaster(AbstractRaster raster)
          Adds a raster to the MultiResolution Pyramid
 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.
 Envelope getEnvelope()
          Returns the (spatial) domain of this coverage.
 AbstractRaster getRaster(double res)
          Returns the best-fitting raster for a given resolution.
 ResolutionInfo getResolutionInfo()
          Returns information about the possible sample resolutions of this coverage.
 List<Double> getResolutions()
          Returns a list with the highest resolution of every level.
 AbstractRaster getSubset(Envelope envelope, double resolution)
          Returns a subset of the raster for a given resolution.
 
Methods inherited from class org.deegree.coverage.AbstractCoverage
destroy, extendEnvelope, getCoordinateSystem, getGeometryFactory, getLabel, getName, getSupplementProperties, init, setCoordinateSystem, setEnvelope, setLabel, setName, setSupplementProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiResolutionRaster

public MultiResolutionRaster()
Create an empty multi resolution raster.

Method Detail

addRaster

public void addRaster(AbstractRaster raster)
Adds a raster to the MultiResolution Pyramid

Parameters:
raster - raster to be added to the MultiResolutionRaster

getRaster

public AbstractRaster getRaster(double res)
Returns the best-fitting raster for a given resolution. This method tries to return the optimal raster for the requested resolution. It returns the next best resolution (lower resolution value) if available, otherwise it returns the next raster with a higher resolution value.

Parameters:
res - resolution in world units per pixel
Returns:
raster for resolution or null if no rasters were defined

getEnvelope

public Envelope getEnvelope()
Description copied from interface: Coverage
Returns the (spatial) domain of this coverage.

Specified by:
getEnvelope in interface Coverage
Overrides:
getEnvelope in class AbstractCoverage
Returns:
The envelope of the coverage.

getSubset

public AbstractRaster getSubset(Envelope envelope,
                                double resolution)
Returns a subset of the raster for a given resolution. The matching raster is selected using getRaster(double).

Parameters:
envelope - envelope of the subset
resolution - resolution in world units per pixel
Returns:
subset of the best-fitting raster
See Also:
getRaster(double)

getResolutions

public List<Double> getResolutions()
Returns a list with the highest resolution of every level. The list is sorted ascending (from highest to lowest resolution).

Returns:
a list of all resolutions

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()
Description copied from interface: Coverage
Returns information about the possible sample resolutions of this coverage.

Returns:
information about the possible sample resolutions.


Copyright © 2011. All Rights Reserved.