deegree-tools-3.0-pre-nightly (2010/03/05 00:05) - official

org.deegree.tools.coverage.rtb
Class TileGrid

java.lang.Object
  extended by org.deegree.tools.coverage.rtb.TileGrid

public class TileGrid
extends Object

This class represents a grid of tiles.

Version:
$Revision: 19845 $, $Date: 2009-09-29 14:54:14 +0200 (Di, 29 Sep 2009) $
Author:
Oliver Tonnhofer, last edited by: $Author: mschneider $

Nested Class Summary
static class TileGrid.Tile
          Simple container class for a tile coordinate and envelope.
 
Method Summary
static double calculateBaseResolution(int srcWidth, int srcHeight, org.deegree.geometry.Envelope dstEnv, int tileSize)
          Calculate the resolution for the first raster level.
static int calculateOptimalTileSize(int srcWidth, int srcHeight, org.deegree.geometry.Envelope dstEnv, int maxTileSize)
          Calculate the optimal tile size, so that the last tile in a raster tree consist of exactly one tile (no borders).
 List<TileGrid.Tile> createTileEnvelopes()
          Create a list with all tiles in this grid.
(package private) static TileGrid createTileGrid(org.deegree.geometry.Envelope dstEnv, int tileSize, float resolution)
          Create a tile grid based on the output envelope, tile size and target pixel resolution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createTileGrid

static TileGrid createTileGrid(org.deegree.geometry.Envelope dstEnv,
                               int tileSize,
                               float resolution)
Create a tile grid based on the output envelope, tile size and target pixel resolution.

Parameters:
dstEnv - the envelope of the target raster (in target SRS)
tileSize - the size of each tile (in pixel)
resolution - the pixel resolution (units/pixel)
Returns:
a new TileGrid

createTileEnvelopes

public List<TileGrid.Tile> createTileEnvelopes()
Create a list with all tiles in this grid.

Returns:
a list of all tiles, stored in row-order

calculateOptimalTileSize

public static int calculateOptimalTileSize(int srcWidth,
                                           int srcHeight,
                                           org.deegree.geometry.Envelope dstEnv,
                                           int maxTileSize)
Calculate the optimal tile size, so that the last tile in a raster tree consist of exactly one tile (no borders).

Parameters:
srcWidth - the width of the source raster (in pixel)
srcHeight - the height of the source raster (in pixel)
dstEnv - the envelope of the target raster (in target SRS)
maxTileSize - the maximum size of each tile (in pixel)
Returns:
the optimal tile size

calculateBaseResolution

public static double calculateBaseResolution(int srcWidth,
                                             int srcHeight,
                                             org.deegree.geometry.Envelope dstEnv,
                                             int tileSize)
Calculate the resolution for the first raster level.

Parameters:
srcWidth - the width of the source raster (in pixel)
srcHeight - the height of the source raster (in pixel)
dstEnv - the envelope of the target raster (in target SRS)
tileSize - the size of each tile (in pixel)
Returns:
the resolution in unit/pixel

deegree-tools-3.0-pre-nightly (2010/03/05 00:05) - official

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

]]>