org.deegree.coverage.raster.container
Class GriddedTileContainer

java.lang.Object
  extended by org.deegree.coverage.raster.container.GriddedTileContainer
All Implemented Interfaces:
TileContainer
Direct Known Subclasses:
GriddedBlobTileContainer, GriddedMemoryTileContainer

public abstract class GriddedTileContainer
extends Object
implements TileContainer

Abstract base class for TileContainers based on a rectangular grid of disjunct, equal-sized cells (raster tiles).

Version:
$Revision: 31644 $, $Date: 2011-08-24 22:27:43 +0200 (Wed, 24 Aug 2011) $
Author:
Markus Schneider, last edited by: $Author: mschneider $

Field Summary
protected  int tileSamplesX
          Number of samples of each raster tile in x-direction.
protected  int tileSamplesY
          Number of samples of each raster tile in y-direction.
 
Constructor Summary
protected GriddedTileContainer(GridMetaInfoFile infoFile)
          Creates a new GriddedTileContainer instances.
protected GriddedTileContainer(RasterGeoReference.OriginLocation location, Envelope envelope, int rows, int columns, int tileSamplesX, int tileSamplesY)
          Creates a new GriddedTileContainer instances.
 
Method Summary
 int getColumns()
          Returns the number of columns of the grid.
 Envelope getEnvelope()
          Returns the envelope of all tiles in this container.
 RasterDataInfo getRasterDataInfo()
          Return the first tile of this container.
 RasterGeoReference getRasterReference()
          Returns the RasterReference of all tiles in this container.
 ResolutionInfo getResolutionInfo()
           
 int getRows()
          Returns the number of rows of the grid.
abstract  AbstractRaster getTile(int rowId, int columnId)
          Returns the raster tile at the given grid position.
protected  Envelope getTileEnvelope(int rowId, int columnId)
          Calculates the envelope for a tile at a given position in the grid.
protected  int getTileId(int columnId, int rowId)
          Calculates the id for a tile at a given position in the grid.
 List<AbstractRaster> getTiles(Envelope env)
          Returns all tiles that intersects the envelope.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tileSamplesX

protected final int tileSamplesX
Number of samples of each raster tile in x-direction.


tileSamplesY

protected final int tileSamplesY
Number of samples of each raster tile in y-direction.

Constructor Detail

GriddedTileContainer

protected GriddedTileContainer(GridMetaInfoFile infoFile)
Creates a new GriddedTileContainer instances.

Parameters:
infoFile - containing the relevant information.

GriddedTileContainer

protected GriddedTileContainer(RasterGeoReference.OriginLocation location,
                               Envelope envelope,
                               int rows,
                               int columns,
                               int tileSamplesX,
                               int tileSamplesY)
Creates a new GriddedTileContainer instances.

Parameters:
location -
envelope - area of the samples of the contained tiles
rows - number of rows in the cell grid
columns - number of columns in the cell grid
tileSamplesX - number of samples of each raster tile in x-direction
tileSamplesY - number of samples of each raster tile in y-direction
Method Detail

getTile

public abstract AbstractRaster getTile(int rowId,
                                       int columnId)
Returns the raster tile at the given grid position.

Parameters:
rowId - row id, must in the range [0 ... #rows - 1]
columnId - column id, must be in the range [0 ... #columns - 1]
Returns:
the raster tile at the given grid position

getTiles

public List<AbstractRaster> getTiles(Envelope env)
Description copied from interface: TileContainer
Returns all tiles that intersects the envelope.

Specified by:
getTiles in interface TileContainer
Parameters:
env - return List with tiles
Returns:
A List with all intersecting tiles.

getEnvelope

public Envelope getEnvelope()
Description copied from interface: TileContainer
Returns the envelope of all tiles in this container.

Specified by:
getEnvelope in interface TileContainer
Returns:
The envelope of all tiles.

getRasterReference

public RasterGeoReference getRasterReference()
Description copied from interface: TileContainer
Returns the RasterReference of all tiles in this container.

Specified by:
getRasterReference in interface TileContainer
Returns:
The raster envelope of the tiles.

getRows

public int getRows()
Returns the number of rows of the grid.

Returns:
the number of rows

getColumns

public int getColumns()
Returns the number of columns of the grid.

Returns:
the number of columns

getTileId

protected int getTileId(int columnId,
                        int rowId)
Calculates the id for a tile at a given position in the grid.

Parameters:
columnId - column id, must be in the range [0 ... #columns - 1]
rowId - row id, must be in the range [0 ... #rows - 1]
Returns:
the tile's id

getTileEnvelope

protected Envelope getTileEnvelope(int rowId,
                                   int columnId)
Calculates the envelope for a tile at a given position in the grid.

Parameters:
columnId - column id, must be in the range [0 ... #columns - 1]
rowId - row id, must be in the range [0 ... #rows - 1]
Returns:
the tile's envelope

getRasterDataInfo

public RasterDataInfo getRasterDataInfo()
Description copied from interface: TileContainer
Return the first tile of this container. First is implementation status.

Specified by:
getRasterDataInfo in interface TileContainer
Returns:
the first tile in the container

getResolutionInfo

public ResolutionInfo getResolutionInfo()
Specified by:
getResolutionInfo in interface TileContainer
Returns:
the information about the resolution


Copyright © 2011. All Rights Reserved.