Public Member Functions | Properties
Grid Class Reference

The grid object is used to represent a grid which can be added to the map. More...

List of all members.

Public Member Functions

bool AssignNewProjection (string Projection)
 Assign new projection to the grid.
void CellToProj (int Column, int Row, out double x, out double y)
 Uses a cell's column and row position to find the center of the cell in projected map coordinates.
bool Clear (object ClearValue)
 Clears all data in the grid, setting the value of all cells in the grid to the specified clear value.
bool Close ()
 Closes the grid.
bool CreateNew (string Filename, GridHeader Header, GridDataType DataType, object InitialValue, bool InRam, GridFileType fileType, ICallback cBack)
 Creates a new grid.
string get_ErrorMsg (int ErrorCode)
 Retrieves the error message associated with the specified error code.
object get_Value (int Column, int Row)
 Returns the value stored in the grid at the specified cell.
bool GetFloatWindow (int StartRow, int EndRow, int StartCol, int EndCol, ref float Vals)
 Returns an array with grid values which lie within specified bounds.
bool GetRow (int Row, ref float Vals)
 The faster way to read the array values that are of a specific size.
bool Open (string Filename, GridDataType DataType, bool InRam, GridFileType fileType, ICallback cBack)
 Opens a grid.
void ProjToCell (double x, double y, out int Column, out int Row)
 Converts a point in projected map coordinates to a cell (column, row) in the grid.
bool PutFloatWindow (int StartRow, int EndRow, int StartCol, int EndCol, ref float Vals)
 Sets an array of values for a given region of the grid.
bool PutRow (int Row, ref float Vals)
bool Resource (string newSrcPath)
 Changes the grid source without closing it.
bool Save (string Filename, GridFileType GridFileType, ICallback cBack)
 Saves the grid.
void set_Value (int Column, int Row, object pVal)
 Sets the value of the specified cell of the grid.
bool SetInvalidValuesToNodata (double MinThresholdValue, double MaxThresholdValue)
 Sets invalid values to no data values.

Properties

string CdlgFilter [get]
 Returns the common dialog filter containing all supported file extensions in string format.
GridDataType DataType [get]
 Returns the data type of the values stored in the grid.
string Filename [get]
 The filename associated with the object.
ICallback GlobalCallback [get, set]
 The global callback is the interface used by MapWinGIS to pass progress and error events to interested applications.
GridHeader Header [get]
 Returns the header of the grid.
bool InRam [get]
 Returns whether the grid is loaded in to RAM memory or not.
string Key [get, set]
 The key may be used by the programmer to store any string data associated with the object.
int LastErrorCode [get]
 Retrieves the last error generated in the object.
object Maximum [get]
 Returns the maximum value stored in the grid.
object Minimum [get]
 Returns the minimum value stored in the grid.
GridColorScheme RasterColorTableColoringScheme [get]
 Gets grid color scheme object used for rendering of the image represenation of the grid.

Detailed Description

The grid object is used to represent a grid which can be added to the map.


Member Function Documentation

bool Grid.AssignNewProjection ( string  Projection)

Assign new projection to the grid.

Parameters:
ProjectionProjection string in proj4 format.
Returns:
True on success or false otherwise.
void Grid.CellToProj ( int  Column,
int  Row,
out double  x,
out double  y 
)

Uses a cell's column and row position to find the center of the cell in projected map coordinates.

Parameters:
ColumnThe column of the cell to find the center in projected map coordinates.
RowThe row of the cell to find the center in projected map coordinates.
xReturns the x projected map coordinate of the center of the specified cell.
yReturns the yprojected map coordinate of the center of the specified cell.
bool Grid.Clear ( object  ClearValue)

Clears all data in the grid, setting the value of all cells in the grid to the specified clear value.

Parameters:
ClearValueThe value to set all of the grid's cells to.
Returns:
A boolean value representing the success or failure of clearing the grid.
bool Grid.Close ( )

Closes the grid.

Returns:
A boolean value representing the success or failure of closing the grid.
bool Grid.CreateNew ( string  Filename,
GridHeader  Header,
GridDataType  DataType,
object  InitialValue,
bool  InRam,
GridFileType  fileType,
ICallback  cBack 
)

Creates a new grid.

Parameters:
FilenameThe filename for the new grid.
HeaderThe header defining the attributes of the new grid.
DataTypeThe data type of the new grid.
InitialValueThe initial value for each cell of the new grid.
InRamOptional. A boolean value representing the grid being stored in memory(RAM) when True, and the grid being stored on disk when False.
fileTypeOptional. The grid file type.
cBackOptional. The ICallback object that will receive the progress and error events during the creation of the new grid.
Returns:
A boolean value representing the success or failure of the creation of the new grid.
string Grid.get_ErrorMsg ( int  ErrorCode)

Retrieves the error message associated with the specified error code.

Parameters:
ErrorCodeThe numeric code of error returned by Grid.LastErrorCode.
Returns:
The description of the error.
object Grid.get_Value ( int  Column,
int  Row 
)

Returns the value stored in the grid at the specified cell.

Parameters:
ColumnThe column representing the cell for which the value is required.
RowThe row representing the cell for which the value is required.
Returns:
The value stored in the grid in the specified cell.
bool Grid.GetFloatWindow ( int  StartRow,
int  EndRow,
int  StartCol,
int  EndCol,
ref float  Vals 
)

Returns an array with grid values which lie within specified bounds.

For inner use or C++ use only. Only a single value will be returned TO .NET.

Parameters:
StartRowThe start row of the window.
EndRowThe end rw of the window.
StartColThe start color of the window.
EndColThe end color of the window.
ValsA supposed array (only a single value in .NET).
Returns:
True on success and false otherwise.
bool Grid.GetRow ( int  Row,
ref float  Vals 
)

The faster way to read the array values that are of a specific size.

The row is the integer row to read from the grid object. The vals variable is actually the first element of the array of floats that you want to be populated with the values from the grid. Since arrays are stored sequentially in memory, passing the first element allows the prediction of where the other values must go. It is very important that you always dimension the array as being of type float, and always make sure that you dimension it from 0 to numCols - 1.

Parameters:
RowThe Integer value of the row to retrieve values for.
ValsReference to the first element of the array of floats that will hold the row of values.
Returns:
True on success and false otherwise.
bool Grid.Open ( string  Filename,
GridDataType  DataType,
bool  InRam,
GridFileType  fileType,
ICallback  cBack 
)

Opens a grid.

Parameters:
FilenameThe filename of the grid to be opened.
DataTypeOptional. The data type of the grid to be opened.
InRamOptional. A boolean value representing whether the grid will be stored in RAM or on disk.
fileTypeOptional. The file type of the grid. The default file type is "Use Extension".
cBackOptional. The ICallback object that will receive the progress and error events during the creation of the new grid.
Returns:
A boolean value that represents the success or failure of opening the grid.
void Grid.ProjToCell ( double  x,
double  y,
out int  Column,
out int  Row 
)

Converts a point in projected map coordinates to a cell (column, row) in the grid.

If the point lies outside the bounds of the grid, a column and row are returned which are outside the boundaries of the grid. For example, if the point lies to the left or lies below the grid boundaries, a negative column or row will be returned. Similarly, if the point lies above or to the right of the grid boundaries, a column or row which is greater than the number of columns or rows will be returned.

Parameters:
xThe x projected map coordinate for which the corresponding cell in the grid is required.
yThe y projected map coordinate for which the corresponding cell in the grid is required.
ColumnThe column the specified point lies within. This value may not be within the valid bounds of the grid.
RowThe row the specified point lies within. This value may not be within the valid bounds of the grid.
bool Grid.PutFloatWindow ( int  StartRow,
int  EndRow,
int  StartCol,
int  EndCol,
ref float  Vals 
)

Sets an array of values for a given region of the grid.

Parameters:
StartRowThe start row of the window.
EndRowThe end rw of the window.
StartColThe start color of the window.
EndColThe end color of the window.
ValsA supposed array (only a single value in .NET).
Returns:
True on success and false otherwise.
bool Grid.PutRow ( int  Row,
ref float  Vals 
)

The faster way to write the array values that are of a specific size. The row is the integer row to read from the grid object. The vals variable is actually the first element of the array of floats that you want to be populated with the values from the grid. Since arrays are stored sequentially in memory, passing the first element allows the prediction of where the other values must go. It is very important that you always dimension the array as being of type float, and always make sure that you dimension it from 0 to numCols - 1.

Parameters:
RowThe Integer value of the row to retrieve values for.
ValsReference to the first element of the array of floats that will hold the row of values.
Returns:
bool Grid.Resource ( string  newSrcPath)

Changes the grid source without closing it.

Parameters:
newSrcPathThe name of the new file source.
Returns:
True on success and false otherwise.
bool Grid.Save ( string  Filename,
GridFileType  GridFileType,
ICallback  cBack 
)

Saves the grid.

Parameters:
FilenameOptional. The filename the grid will be saved under. If no filename is specified the filename in the grid's Filename property is used.
GridFileTypeOptional. The file type to save the grid as. If no type is specified, the type stored in the grid object is used.
cBackOptional. The ICallback object that will receive the progress and error events during the creation of the new grid.
Returns:
A boolean value representing the success or failure of saving the grid.
void Grid.set_Value ( int  Column,
int  Row,
object  pVal 
)

Sets the value of the specified cell of the grid.

Parameters:
ColumnThe index of the cell's column.
RowThe index of the cell's row.
pValThe new value as variant data type.
bool Grid.SetInvalidValuesToNodata ( double  MinThresholdValue,
double  MaxThresholdValue 
)

Sets invalid values to no data values.

Parameters:
MinThresholdValueThe minimum valid value.
MaxThresholdValueThe maximum valid value.
Returns:
True in success and false otherwise.

Property Documentation

string Grid.CdlgFilter [get]

Returns the common dialog filter containing all supported file extensions in string format.

Returns the data type of the values stored in the grid.

string Grid.Filename [get]

The filename associated with the object.

The global callback is the interface used by MapWinGIS to pass progress and error events to interested applications.

Returns the header of the grid.

bool Grid.InRam [get]

Returns whether the grid is loaded in to RAM memory or not.

string Grid.Key [get, set]

The key may be used by the programmer to store any string data associated with the object.

int Grid.LastErrorCode [get]

Retrieves the last error generated in the object.

object Grid.Maximum [get]

Returns the maximum value stored in the grid.

object Grid.Minimum [get]

Returns the minimum value stored in the grid.

Gets grid color scheme object used for rendering of the image represenation of the grid.

 All Classes Files Functions Enumerations Properties