deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.tools.raster
Class RasterTreeBuilder

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

public class RasterTreeBuilder
extends 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: 20078 $, $Date: 2009-10-09 11:40:15 +0200 (Fr, 09. Okt 2009) $
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(List<String> imageFiles, String outputDir, String baseName, String outputFormat, double maxTileSize, String srs, String interpolation, WorldFile.TYPE worldFileType, float quality, String bgColor, int depth, double resolution, float offset, float scaleFactor)
           
RasterTreeBuilder(List<String> imageFiles, String outputDir, String baseName, String outputFormat, double maxTileSize, String srs, String interpolation, WorldFile.TYPE worldFileType, float quality, String bgColor, int depth, double resolution, float offset, float scaleFactor, boolean dummy)
           
 
Method Summary
static Object createInterpolation(String interpolation)
           
static void drawImage(BufferedImage out, float[][] data, javax.media.jai.TiledImage image, Tile tile, WorldFile wf, double minimumRes, Object interpolation, Map<String,String> imageFilesErrors, String outputFormat, int bitDepth, float offset, float scaleFactor)
          Draws an image map to the target tile considering defined interpolation method for rescaling.
static GraphicsConfiguration getDefaultConfiguration()
           
 void init(Envelope env, double resolution)
           
 void logCollectedErrors()
           
static void main(String[] args)
           
static BufferedImage resize(BufferedImage source, int destWidth, int destHeight, 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(List<String> imageFiles,
                         String outputDir,
                         String baseName,
                         String outputFormat,
                         double maxTileSize,
                         String srs,
                         String interpolation,
                         WorldFile.TYPE worldFileType,
                         float quality,
                         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(List<String> imageFiles,
                         String outputDir,
                         String baseName,
                         String outputFormat,
                         double maxTileSize,
                         String srs,
                         String interpolation,
                         WorldFile.TYPE worldFileType,
                         float quality,
                         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 IOException
Throws:
IOException

start

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

Throws:
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(BufferedImage out,
                             float[][] data,
                             javax.media.jai.TiledImage image,
                             Tile tile,
                             WorldFile wf,
                             double minimumRes,
                             Object interpolation,
                             Map<String,String> imageFilesErrors,
                             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

getDefaultConfiguration

public static GraphicsConfiguration getDefaultConfiguration()

resize

public static BufferedImage resize(BufferedImage source,
                                   int destWidth,
                                   int destHeight,
                                   Object interpolation)

createInterpolation

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

main

public static void main(String[] args)
                 throws 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:
Exception

deegree 2.3 (2010/04/09 10:10 build-4-official)

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