Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| deegree 2.4 (2010/11/11 10:47 build-27-official)
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.deegree.tools.raster
Class RasterTreeBuilder

    java.lang.Object
      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:

- maxElementsInMemory = 10
- memoryStoreEvictionPolicy = LFU
- overflowToDisk = false (notice that overflow to disk is not supported because cached objects are not serializable)
- eternal = false
- timeToLiveSeconds = 3600
- timeToIdleSeconds = 3600

Since:
  2.0
Version:
  2.0, $Revision: 23148 $, $Date: 2010-03-18 09:56:26 +0100 (Do, 18. Mär 2010) $
Author:
  Judit Mays, Andreas Poth, last edited by: $Author: hrubach $

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.
`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

### 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`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| deegree 2.4 (2010/11/11 10:47 build-27-official)
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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