deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.tools.raster
Class RasterTreeBuilder

java.lang.Object
  extended by org.deegree.tools.raster.RasterTreeBuilder

public class RasterTreeBuilder
extends java.lang.Object

This class represents a RasterTreeBuilder object.
It wcan be used to create a resolution pyramid from one or more already existing raster dataset (image). The resulting pyramid will be described by a set of shapes (containing the image tiles bounding boxes) and a XML coverage description document that can be used with the deegree WCS. The RTB supports real images like png, tif, jpeg, bmp and gif as well as raw data image like 16Bit and 32Bit tif-images without color model.
because of the large amount of data that may be process by the RTB it makes use of a caching mechnism. For this the ehcache project is used. One can configure the cache behavior by placing a file named ehcache.xml defining a cache named 'imgCache' within the class root when starting the RTB. (For details please see the ehcache documentation). If no ehcache.xml is available default cache configuration will be used which is set to:

Since:
2.0
Version:
2.0, $Revision: 29229 $, $Date: 2011-01-12 09:24:21 +0100 (Mi, 12 Jan 2011) $
Author:
Judit Mays, Andreas Poth, last edited by: $Author: apoth $

Nested Class Summary
(package private) static class RasterTreeBuilder.DFileFilter
          class: official version of a FilenameFilter
 
Constructor Summary
RasterTreeBuilder(java.util.List<java.lang.String> imageFiles, java.lang.String outputDir, java.lang.String baseName, java.lang.String outputFormat, double maxTileSize, java.lang.String srs, java.lang.String interpolation, WorldFile.TYPE worldFileType, float quality, java.lang.String bgColor, int depth, double resolution, float offset, float scaleFactor)
           
RasterTreeBuilder(java.util.List<java.lang.String> imageFiles, java.lang.String outputDir, java.lang.String baseName, java.lang.String outputFormat, double maxTileSize, java.lang.String srs, java.lang.String interpolation, WorldFile.TYPE worldFileType, float quality, java.lang.String bgColor, int depth, double resolution, float offset, float scaleFactor, boolean dummy)
           
 
Method Summary
static java.lang.Object createInterpolation(java.lang.String interpolation)
           
static void drawImage(java.awt.image.BufferedImage out, float[][] data, javax.media.jai.TiledImage image, Tile tile, WorldFile wf, double minimumRes, java.lang.Object interpolation, java.util.Map<java.lang.String,java.lang.String> imageFilesErrors, java.lang.String outputFormat, int bitDepth, float offset, float scaleFactor)
          Draws an image map to the target tile considering defined interpolation method for rescaling.
 void init(Envelope env, double resolution)
           
 void logCollectedErrors()
           
static void main(java.lang.String[] args)
           
static java.awt.image.BufferedImage resize(java.awt.image.BufferedImage source, int destWidth, int destHeight, java.lang.Object interpolation)
           
 void setEnvelope(Envelope bbox)
          sets the bounding box used for tiling
 void setResolution(double resolution)
          sets the resolution level to be used for tiling
 void start()
          starts creating of a raster tile level using the current bbox and resolution
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RasterTreeBuilder

public RasterTreeBuilder(java.util.List<java.lang.String> imageFiles,
                         java.lang.String outputDir,
                         java.lang.String baseName,
                         java.lang.String outputFormat,
                         double maxTileSize,
                         java.lang.String srs,
                         java.lang.String interpolation,
                         WorldFile.TYPE worldFileType,
                         float quality,
                         java.lang.String bgColor,
                         int depth,
                         double resolution,
                         float offset,
                         float scaleFactor,
                         boolean dummy)
Parameters:
imageFiles -
outputDir -
baseName -
outputFormat -
maxTileSize -
srs -
interpolation -
worldFileType -
quality -
bgColor -
depth -
resolution -
offset -
scaleFactor -
dummy -

RasterTreeBuilder

public RasterTreeBuilder(java.util.List<java.lang.String> imageFiles,
                         java.lang.String outputDir,
                         java.lang.String baseName,
                         java.lang.String outputFormat,
                         double maxTileSize,
                         java.lang.String srs,
                         java.lang.String interpolation,
                         WorldFile.TYPE worldFileType,
                         float quality,
                         java.lang.String bgColor,
                         int depth,
                         double resolution,
                         float offset,
                         float scaleFactor)
Parameters:
imageFiles -
outputDir -
baseName -
outputFormat -
maxTileSize -
srs -
interpolation -
worldFileType -
quality -
bgColor -
depth -
resolution -
offset -
scaleFactor -
Method Detail

logCollectedErrors

public void logCollectedErrors()
                        throws java.io.IOException
Throws:
java.io.IOException

start

public void start()
           throws java.lang.Exception
starts creating of a raster tile level using the current bbox and resolution

Throws:
java.lang.Exception

init

public void init(Envelope env,
                 double resolution)
Parameters:
env -
resolution -

setResolution

public void setResolution(double resolution)
sets the resolution level to be used for tiling

Parameters:
resolution -

setEnvelope

public void setEnvelope(Envelope bbox)
sets the bounding box used for tiling

Parameters:
bbox -

drawImage

public static void drawImage(java.awt.image.BufferedImage out,
                             float[][] data,
                             javax.media.jai.TiledImage image,
                             Tile tile,
                             WorldFile wf,
                             double minimumRes,
                             java.lang.Object interpolation,
                             java.util.Map<java.lang.String,java.lang.String> imageFilesErrors,
                             java.lang.String outputFormat,
                             int bitDepth,
                             float offset,
                             float scaleFactor)
Draws an image map to the target tile considering defined interpolation method for rescaling. This method is static so it can be used easily from the RasterTreeUpdater.

Parameters:
out - target image tile
data -
image - source image map
tile - tile description, must contain the envelope of the target image
wf - must contain the envelope of the TiledImage of the source image
minimumRes - the minimum resolution of input images
interpolation - the interpolation method
imageFilesErrors - a mapping between image files and errors
outputFormat - the output format
bitDepth - the output bit depth
offset - offset used if bitDepth = 16 and outputFormat = raw
scaleFactor - scale factor used if bitDepth = 16 and outputFormat = raw

resize

public static java.awt.image.BufferedImage resize(java.awt.image.BufferedImage source,
                                                  int destWidth,
                                                  int destHeight,
                                                  java.lang.Object interpolation)

createInterpolation

public static java.lang.Object createInterpolation(java.lang.String interpolation)
Parameters:
interpolation -
Returns:
an interpolation object from a well known name

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Parameters:
args - Example arguments to pass when calling are:
  • -mapFiles D:/temp/europe_DK.jpg,D:/temp/europe_BeNeLux.jpg
  • -outDir D:/temp/out/
  • -baseName pretty
  • -outputFormat png
  • -maxTileSize 600
Throws:
java.lang.Exception

deegree 2.5 (2011/06/29 09:44 build-8-official)

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