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: 29649 $, $Date: 2011-02-11 15:34:44 +0100 (Fri, 11 Feb 2011) $
Author:
Oliver Tonnhofer, last edited by: $Author: aschmitz $

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, Envelope dstEnv, int tileSize)
          Calculate the resolution for the first raster level.
static int calculateOptimalTileSize(int srcWidth, int srcHeight, 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

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,
                                           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,
                                             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


Copyright © 2011. All Rights Reserved.