Interface ILcdRaster
- All Superinterfaces:
ILcdBounded
,ILcdCache
- All Known Subinterfaces:
ILcdExtendedLineOfSightCoverage
,ILcdLineOfSightCoverage
- All Known Implementing Classes:
ALcdRaster
,TLcdCADRGRaster
,TLcdGeoSPOTRaster
,TLcdInterpolatedRaster
,TLcdRaster
,TLcdSingleTileRaster
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.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the optional color model of the raster.int
Returns the pixel value that is returned for points outside the bounds of the raster.double
Returns the average number of pixels per unit of area in raster coordinates.int
Returns the pixel size of the tiles in this raster, expressed in bits.int
Returns the number of the tile columns in the raster.double
Returns the height of a single tile, expressed in raster coordinates.int
Returns the number of the tile rows in the raster.double
Returns the width of a single tile, expressed in raster coordinates.int
getType()
Returns the internal storage type of the raster values.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 theColorModel
of the raster.void
setDefaultValue
(int aValue) Sets the pixel value that is returned for points outside the bounds of the raster.Methods inherited from interface com.luciad.shape.ILcdBounded
getBounds
Methods inherited from interface com.luciad.util.ILcdCache
clearCache, getCachedObject, insertIntoCache, removeCachedObject
-
Method Details
-
getTileWidth
double getTileWidth()Returns the width of a single tile, expressed in raster coordinates. Note that the tiles in the last (right-most) column can be smaller then other columns. The width of the last column is:getBounds().getWidth() - getTileWidth() * (getTileColumnCount() - 1)
-
getTileHeight
double getTileHeight()Returns the height of a single tile, expressed in raster coordinates. Note that the tiles in the last (bottom) row can be smaller then other rows. The height of the last row is:getBounds().getHeight() - getTileHeight() * (getTileRowCount() - 1)
-
getTileRowCount
int getTileRowCount()Returns the number of the tile rows in the raster. -
getTileColumnCount
int getTileColumnCount()Returns the number of the tile columns in the raster. -
getPixelDensity
double getPixelDensity()Returns the average number of pixels per unit of area in raster coordinates. -
getType
int getType()Returns the internal storage type of the raster values.- Returns:
- one of
ILcdTile.BYTE
,ILcdTile.SHORT
, orILcdTile.INT
.
-
getPixelSize
int getPixelSize()Returns the pixel size of the tiles in this raster, expressed in bits. -
getDefaultValue
int getDefaultValue()Returns the pixel value that is returned for points outside the bounds of the raster.- See Also:
-
setDefaultValue
void setDefaultValue(int aValue) Sets the pixel value that is returned for points outside the bounds of the raster.- Parameters:
aValue
- the default pixel value.
-
retrieveTile
Retrieves the specified tile.- Parameters:
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.- Returns:
- the specified tile.
-
retrieveValue
int retrieveValue(double aX, double aY) Retrieves the raster value at the specified location.- Parameters:
aX
- the x ordinate of the value, expressed in raster coordinates.aY
- the y ordinate of the value, expressed in raster coordinates.- Returns:
- the integer raster value at the specified location.
-
getColorModel
ColorModel getColorModel()Returns the optional color model of the raster.- Returns:
- the color model, or
null
if the raster doesn't have an explicit color model.
-
setColorModel
Sets theColorModel
of the raster.- Parameters:
aColorModel
- the color model.
-