public interface ILcdRaster extends ILcdBounded, ILcdCache
Important notice: the package com.luciad.imaging
presents a new API
for the modeling of raster data. For new projects, it is recommended to use
this API instead of ILcdRaster
et al.
A raster is defined over a rectangular, axis-aligned area in a local coordinate system. This raster coordinate system typically corresponds to the model coordinate system. The raster location, width, height, and coordinates are expressed as doubles. The x and y axes are pointing to the right and up respectively.
A raster is composed of a regular grid of rectangular tiles. Each tile is a regular matrix of integer values. The interface provides methods to retrieve entire tiles or individual values.
The tiles in the raster are ordered left-to-right, top-to-bottom. They all have the same size in the raster coordinate system, but their sizes in pixels may vary. For instance, an elevation raster in a geodetic coordinate system can have tile that are all 1 degree by 1 degree, but that have decreasing sizes in pixels toward the poles.
The combined width and height of the tiles is typically equal to the width and height of the raster. However the combined width and height may also be larger. In this case the bottom row and the right-most column of tiles only cover the remaining part of the raster's bounds. They can thus be smaller in raster coordinates than the other rows and columns.
A raster always has a pixel density, which is the average number of pixels per unit of area in raster coordinates. For instance, a raster representing a satellite image at 1m resolution would have a pixel density of 1 pixel/m^2. This value is generally useful for determining whether a raster is suitable for analysis or display at a certain zoom level, without having to look at its contents.
A raster can optionally have a ColorModel
that specifies how
the raster values can be displayed.
Modifier and Type | Method and Description |
---|---|
ColorModel |
getColorModel()
Returns the optional color model of the raster.
|
int |
getDefaultValue()
Returns the pixel value that is returned for points outside the bounds of
the raster.
|
double |
getPixelDensity()
Returns the average number of pixels per unit of area in raster
coordinates.
|
int |
getPixelSize()
Returns the pixel size of the tiles in this raster, expressed in bits.
|
int |
getTileColumnCount()
Returns the number of the tile columns in the raster.
|
double |
getTileHeight()
Returns the height of a single tile, expressed in raster coordinates.
|
int |
getTileRowCount()
Returns the number of the tile rows in the raster.
|
double |
getTileWidth()
Returns the width of a single tile, expressed in raster coordinates.
|
int |
getType()
Returns the internal storage type of the raster values.
|
ILcdTile |
retrieveTile(int aRow,
int aColumn)
Retrieves the specified tile.
|
int |
retrieveValue(double aX,
double aY)
Retrieves the raster value at the specified location.
|
void |
setColorModel(ColorModel aColorModel)
Sets the
ColorModel of the raster. |
void |
setDefaultValue(int aValue)
Sets the pixel value that is returned for points outside the bounds of
the raster.
|
getBounds
clearCache, getCachedObject, insertIntoCache, removeCachedObject
double getTileWidth()
getBounds().getWidth() - getTileWidth() * (getTileColumnCount() - 1)
double getTileHeight()
getBounds().getHeight() - getTileHeight() * (getTileRowCount() - 1)
int getTileRowCount()
int getTileColumnCount()
double getPixelDensity()
int getType()
ILcdTile.BYTE
,
ILcdTile.SHORT
, or
ILcdTile.INT
.int getPixelSize()
int getDefaultValue()
retrieveValue(double, double)
void setDefaultValue(int aValue)
aValue
- the default pixel value.ILcdTile retrieveTile(int aRow, int aColumn)
aRow
- the row number of the tile in the grid of tiles,
ranging between 0 and the number of rows minus 1.aColumn
- the column number of the tile in the grid of tiles,
ranging between 0 and the number of columns minus 1.int retrieveValue(double aX, double aY)
aX
- the x ordinate of the value, expressed in raster coordinates.aY
- the y ordinate of the value, expressed in raster coordinates.ColorModel getColorModel()
null
if the raster doesn't have
an explicit color model.void setColorModel(ColorModel aColorModel)
ColorModel
of the raster.aColorModel
- the color model.