Interface IRaster<TValue>
The contract describing the all required metadata for a raster implementation.
Assembly: Mars.Interfaces.dll
Syntax
public interface IRaster<TValue>
Type Parameters
Properties
Bands
Gets or sets the list of bands, which are in turn raster's.
The raster's contain only one band each, instead of the list of all the bands like the parent raster.
Declaration
IRaster[] Bands { get; set; }
Property Value
CellHeight
Gets or sets the geographic height of a cell the projected units. Setting this will
automatically adjust the affine coefficient to a negative value.
Declaration
double CellHeight { get; set; }
Property Value
Type |
Description |
System.Double |
|
CellWidth
Gets or sets the geographic width of a cell in the projected units.
Declaration
double CellWidth { get; set; }
Property Value
Type |
Description |
System.Double |
|
CurrentBand
Gets a zero-based integer band index that specifies which of the internal bands
is currently being used for requests of data.
Declaration
Property Value
Type |
Description |
System.Int32 |
|
EndColumn
Gets the integer column index for the right column of this raster. Most of the time this will
be NumColumns - 1. However, if this raster is a window taken from a larger raster, then
it will be the index of the endColumn from the window.
Declaration
Property Value
Type |
Description |
System.Int32 |
|
EndRow
Gets the integer row index for the end row of this raster. Most of the time this will
be numRows - 1. However, if this raster is a window taken from a larger raster, then
it will be the index of the endRow from the window.
Declaration
Property Value
Type |
Description |
System.Int32 |
|
Height
Gets the vertical count of the cells in the raster.
Declaration
Property Value
Type |
Description |
System.Int32 |
|
Item[Position]
Declaration
TValue this[Position pos] { get; set; }
Parameters
Type |
Name |
Description |
Position |
pos |
The position of a cell to get or set the data value. |
Property Value
Item[Int32, Int32]
Gets or sets the value on the
CurrentBand given a x and y index.
Declaration
TValue this[int x, int y] { get; set; }
Parameters
Type |
Name |
Description |
System.Int32 |
x |
The x coordinate of the cell |
System.Int32 |
y |
The y coordinate of the cell |
Property Value
LowerLeft
The lower left corner as a geospatial
Position.
Declaration
Position LowerLeft { get; }
Property Value
Maximum
Gets the maximum data value, not counting no-data values in the grid.
Declaration
Property Value
Type |
Description |
System.Nullable<System.Double> |
|
Mean
Gets the mean of the non-NoData values in this grid.
Declaration
Property Value
Type |
Description |
System.Nullable<System.Double> |
|
Minimum
Gets the minimum data value that is not classified as a no data value in this raster.
Declaration
Property Value
Type |
Description |
System.Nullable<System.Double> |
|
NoDataValue
Gets or sets a float showing the no-data values.
Declaration
double? NoDataValue { get; set; }
Property Value
Type |
Description |
System.Nullable<System.Double> |
|
NumBands
Gets the number of bands. In most traditional grid formats, this is 1. For RGB images,
this would be 3. Some formats may have many bands.
Declaration
Property Value
Type |
Description |
System.Int32 |
|
StartColumn
Gets the integer column index for the left column of this raster. Most of the time this will
be 0. However, if this raster is a window taken from a file, then
it will be the row index in the file for the top row of this raster.
Declaration
Property Value
Type |
Description |
System.Int32 |
|
StartRow
Gets the integer row index for the top row of this raster. Most of the time this will
be 0. However, if this raster is a window taken from a file, then
it will be the row index in the file for the left row of this raster.
Declaration
Property Value
Type |
Description |
System.Int32 |
|
UpperRight
The upper right corner as a geospatial
Position.
Declaration
Position UpperRight { get; }
Property Value
Width
Gets the horizontal count of the cells in the raster.
Declaration
Property Value
Type |
Description |
System.Int32 |
|
Methods
ReadBlock(Int32, Int32, Int32, Int32)
Returns a subset from the file that includes only the specified offsets. The result is a raster,
and the extents are calculated, but the row and column values are in terms of the window,
not the original raster. The band can be controlled by setting the
CurrentBand first.
Declaration
IRaster<TValue> ReadBlock(int xOff, int yOff, int sizeX, int sizeY)
Parameters
Type |
Name |
Description |
System.Int32 |
xOff |
X axis or horizontal offset (0 based from left) |
System.Int32 |
yOff |
Y axis or vertical offset (0 based from top) |
System.Int32 |
sizeX |
Number of columns |
System.Int32 |
sizeY |
Number of rows |
Returns
Type |
Description |
IRaster<TValue> |
An IRaster created from the appropriate type;. |
WriteBlock(IRaster<TValue>, Int32, Int32, Int32, Int32)
This writes the values to the file, even if the
IRaster has more
values than the
xSize
or
ySize
stipulate, and even if the
source raster has values of a different type.
Declaration
void WriteBlock(IRaster<TValue> blockValues, int xOff, int yOff, int xSize, int ySize)
Parameters
Type |
Name |
Description |
IRaster<TValue> |
blockValues |
The IRaster that contains data values to write to the file |
System.Int32 |
xOff |
The 0 based integer horizontal offset from the left |
System.Int32 |
yOff |
The 0 based integer vertical offset from the top |
System.Int32 |
xSize |
The integer number of columns to write |
System.Int32 |
ySize |
The integer number of rows to write |