|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.leeds.ccg.andyt.grids.process.Grid2DSquareCellProcessor
public class Grid2DSquareCellProcessor
A class holding methods for processing an individual AbstractGrid2DSquareCell or multiple Grid2DSquareCellAbstracts. TODO: Implement a general replace method ( depricate/replace mask methods ).
Constructor Summary | |
---|---|
Grid2DSquareCellProcessor()
Creates a new instance of Grid2DSquareCellDoubleProcessor |
|
Grid2DSquareCellProcessor(java.io.File _Directory)
Creates a new instance of Grid2DSquareCellDoubleProcessor. |
|
Grid2DSquareCellProcessor(java.io.File _Directory,
boolean appendToLogFile)
Creates a new instance of Grid2DSquareCellDoubleProcessor. |
|
Grid2DSquareCellProcessor(Grids_Environment _Grids_Environment)
|
Method Summary | |
---|---|
void |
_Output(AbstractGrid2DSquareCell _Grid2DSquareCell,
java.io.File _Output_Directory,
ImageExporter _ImageExporter,
java.lang.String[] _ImageTypes,
ESRIAsciiGridExporter _ESRIAsciiGridExporter,
boolean handleOutOfMemoryError)
For outputting _Grid2DSquareCell to various formats of file. |
void |
_OutputESRIAsciiGrid(AbstractGrid2DSquareCell _Grid2DSquareCell,
java.io.File _Output_Directory,
ESRIAsciiGridExporter _ESRIAsciiGridExporter,
boolean handleOutOfMemoryError)
|
void |
_OutputImage(AbstractGrid2DSquareCell _Grid2DSquareCell,
java.io.File _Output_Directory,
ImageExporter _ImageExporter,
java.lang.String[] _ImageTypes,
boolean handleOutOfMemoryError)
|
Grid2DSquareCellDouble |
_Rescale(AbstractGrid2DSquareCell _InputGrid,
java.lang.String type,
double min,
double max,
boolean handleOutOfMemoryError)
|
void |
addToGrid(Grid2DSquareCellDouble grid,
AbstractGrid2DSquareCell.CellID[] _CellIDs,
double value,
boolean handleOutOfMemoryError)
Adds value to grid for cells with CellID in _CellIDs |
void |
addToGrid(Grid2DSquareCellDouble grid,
double value,
boolean handleOutOfMemoryError)
Adds value to every cell of grid. |
void |
addToGrid(Grid2DSquareCellDouble grid,
java.io.File file,
java.lang.String type,
boolean handleOutOfMemoryError)
Returns grid with values added from a file. |
void |
addToGrid(Grid2DSquareCellDouble grid,
Grid2DSquareCellDouble gridToAdd,
boolean handleOutOfMemoryError)
Add gridToAdd to grid |
void |
addToGrid(Grid2DSquareCellDouble grid,
Grid2DSquareCellDouble gridToAdd,
double weight,
boolean handleOutOfMemoryError)
Add gridToAdd to grid with values from gridToAdd multiplied by weight. |
void |
addToGrid(Grid2DSquareCellDouble grid,
Grid2DSquareCellDouble gridToAdd,
long startRowIndex,
long startColIndex,
long endRowIndex,
long endColIndex,
java.math.BigDecimal[] dimensionConstraints,
double weight,
boolean handleOutOfMemoryError)
Returns a Grid2DSquareCellDouble with values of grid added with values from gridToAdd (with row index between startRowIndex, endRowIndex and column index between startColIndex, endColIndex) multiplied by weight. |
void |
addToGrid(Grid2DSquareCellDouble grid,
Grid2DSquareCellDouble gridToAdd,
long startRowIndex,
long startColIndex,
long endRowIndex,
long endColIndex,
double weight,
boolean handleOutOfMemoryError)
Add gridToAdd to grid with values from gridToAdd multiplied by weight. |
void |
addToGrid(Grid2DSquareCellDouble grid,
java.util.HashSet _CellIDs,
double value,
boolean handleOutOfMemoryError)
Adds value to grid for cells with CellID in _CellIDs |
Grid2DSquareCellDouble |
aggregate(AbstractGrid2DSquareCell grid,
int cellFactor,
java.lang.String statistic,
int rowOffset,
int colOffset,
Grid2DSquareCellDoubleFactory gridFactory,
boolean handleOutOfMemoryError)
Returns an Grid2DSquareCellDouble at a lower level of resolution than grid. |
Grid2DSquareCellDouble |
aggregate(AbstractGrid2DSquareCell grid,
java.lang.String statistic,
java.math.BigDecimal[] resultDimensions,
Grid2DSquareCellDoubleFactory gridFactory,
boolean handleOutOfMemoryError)
Returns an Grid2DSquareCellDouble at a lower level of resolution than grid. |
protected double |
angle(double x1,
double y1,
double x2,
double y2)
Returns the clockwise angle in radians to the y axis of the line from (x1,y1) to (x2,y2). |
double |
angle(double x1,
double y1,
double x2,
double y2,
boolean handleOutOfMemoryError)
Returns the clockwise angle in radians to the y axis of the line from (x1,y1) to (x2,y2). |
double |
angle(double x1,
double y1,
double x2,
double y2,
int nChunkCols,
int _ChunkRowIndex,
int _ChunkColIndex,
boolean handleOutOfMemoryError)
Returns the clockwise angle in radians to the y axis of the line from (x1,y1) to (x2,y2). |
void |
copyAndSetUpNewLog(java.io.File newLog,
boolean handleOutOfMemoryError)
Copies and sets up a new log. |
protected double |
distance(double x1,
double y1,
double x2,
double y2)
Returns the distance between a pair of coordinates |
double |
distance(double x1,
double y1,
double x2,
double y2,
boolean handleOutOfMemoryError)
Returns the distance between a pair of coordinates |
double |
distance(double x1,
double y1,
double x2,
double y2,
int nChunkCols,
int _ChunkRowIndex,
int _ChunkColIndex,
boolean handleOutOfMemoryError)
Returns the distance between a pair of coordinates |
java.io.File |
get_Directory(boolean handleOutOfMemoryError)
Returns a copy of this._Directory |
protected AbstractGrid2DSquareCell |
getGrid2DSquareCell()
Returns a AbstractGrid2DSquareCell from this._AbstractGrid2DSquareCell_HashSet. |
AbstractGrid2DSquareCell |
getGrid2DSquareCell(boolean handleOutOfMemoryError)
Returns a AbstractGrid2DSquareCell from this._AbstractGrid2DSquareCell_HashSet. |
protected double[][] |
getRowProcessData(Grid2DSquareCellDouble grid,
double[][] previous,
int cellDistance,
long row,
long col)
Returns a double[][] based on previous which has been shuffled |
protected double[][] |
getRowProcessInitialData(Grid2DSquareCellDouble grid,
int cellDistance,
long row)
Returns a double[][] of grid values |
protected long |
getTime0()
Returns a copy of this.startTime. |
long |
getTime0(boolean handleOutOfMemoryError)
|
protected void |
log(int logIndentation,
java.lang.String string)
Writes string to log file and the console (standard output) indenting string by logIndentation amount of white-space. |
void |
log(int logIndentation,
java.lang.String string,
boolean handleOutOfMemoryError)
Writes string to log file and the console (standard output) indenting string by logIndentation amount of white-space. |
void |
log(java.lang.String string,
boolean handleOutOfMemoryError)
Writes string to log file and the console (standard output) |
void |
mask(AbstractGrid2DSquareCell grid,
AbstractGrid2DSquareCell mask,
boolean handleOutOfMemoryError)
Modifies grid by setting to grid.noDataValue those cells coincident with mask.noDataValue cells. |
void |
mask(AbstractGrid2DSquareCell grid,
double min,
double max,
boolean handleOutOfMemoryError)
Modifies grid with the values of cells in the range [min,max] set to its noDataValue. |
void |
mask(AbstractGrid2DSquareCell grid,
double xmin,
double ymin,
double xmax,
double ymax,
boolean handleOutOfMemoryError)
Modifies grid by setting to grid.noDataValue those cells that's centroids intersect the rectangle given by: (xmin,ymin,xmax,ymax). |
void |
mask(AbstractGrid2DSquareCell grid,
long startRowIndex,
long startColIndex,
long endRowIndex,
long endColIndex,
boolean handleOutOfMemoryError)
Modifies grid by setting to grid.noDataValue those cells that intersect the rectangle given by: (startRowIndex,startColIndex,endRowIndex,endColIndex). |
protected void |
set_Directory(java.io.File _Directory)
Changes this._Directory, this._Grid2DSquareCellDoubleFactory._Directory, this._Grid2DSquareCellIntFactory._Directory to _Directory. |
protected void |
set_Directory(java.io.File _Directory,
boolean handleOutOfMemoryError)
Changes _Directory to that passed in if it can be created. |
void |
set_Directory(java.io.File _Directory,
boolean copyLogFile,
boolean handleOutOfMemoryError)
Changes this._Directory to that passed in if it can be created. |
void |
setValueALittleBitLarger(Grid2DSquareCellDouble grid,
java.util.HashSet _CellIDs,
boolean handleOutOfMemoryError)
Modifies grid so value of cells with CellIDs in _CellIDs are set to a value a little bit larger. |
void |
setValueALittleBitSmaller(Grid2DSquareCellDouble grid,
java.util.HashSet _CellIDs,
boolean handleOutOfMemoryError)
Modifies grid so value of cells with CellIDs in _CellIDs are set to a value a little bit smaller. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected long startTime
protected java.io.PrintWriter log
protected int logIndentation
protected java.io.File _Directory
public AbstractGrid2DSquareCellIntChunkFactory _Grid2DSquareCelllIntChunkFactory
public Grid2DSquareCellIntChunk64CellMapFactory _Grid2DSquareCellIntChunk64CellMapFactory
public Grid2DSquareCellIntChunkArrayFactory _Grid2DSquareCellIntChunkArrayFactory
public Grid2DSquareCellIntChunkJAIFactory _Grid2DSquareCellIntChunkJAIFactory
public Grid2DSquareCellIntChunkMapFactory _Grid2DSquareCellIntChunkMapFactory
public Grid2DSquareCellIntChunkRAFFactory _Grid2DSquareCellIntChunkRAFFactory
public Grid2DSquareCellIntFactory _Grid2DSquareCellIntFactory
public AbstractGrid2DSquareCellDoubleChunkFactory _Grid2DSquareCellDoubleChunkFactory
public Grid2DSquareCellDoubleChunk64CellMapFactory _Grid2DSquareCellDoubleChunk64CellMapFactory
public Grid2DSquareCellDoubleChunkArrayFactory _Grid2DSquareCellDoubleChunkArrayFactory
public Grid2DSquareCellDoubleChunkJAIFactory _Grid2DSquareCellDoubleChunkJAIFactory
public Grid2DSquareCellDoubleChunkMapFactory _Grid2DSquareCellDoubleChunkMapFactory
public Grid2DSquareCellDoubleChunkRAFFactory _Grid2DSquareCellDoubleChunkRAFFactory
public Grid2DSquareCellDoubleFactory _Grid2DSquareCellDoubleFactory
public GridStatistics0 _GridStatistics0
public GridStatistics1 _GridStatistics1
public AbstractGridStatistics _GridStatistics
Constructor Detail |
---|
public Grid2DSquareCellProcessor()
public Grid2DSquareCellProcessor(java.io.File _Directory)
_Directory
- public Grid2DSquareCellProcessor(Grids_Environment _Grids_Environment)
public Grid2DSquareCellProcessor(java.io.File _Directory, boolean appendToLogFile)
_Directory
- appendToLogFile
- Method Detail |
---|
protected long getTime0()
public long getTime0(boolean handleOutOfMemoryError)
handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught in this method
then swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.
public java.io.File get_Directory(boolean handleOutOfMemoryError)
public AbstractGrid2DSquareCell getGrid2DSquareCell(boolean handleOutOfMemoryError)
handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught in this method then swap
operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.protected AbstractGrid2DSquareCell getGrid2DSquareCell()
protected void set_Directory(java.io.File _Directory, boolean handleOutOfMemoryError)
_Directory
- The _Directory to change to.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.protected void set_Directory(java.io.File _Directory)
_Directory
- The _Directory to change to.public void set_Directory(java.io.File _Directory, boolean copyLogFile, boolean handleOutOfMemoryError)
_Directory
- The _Directory to change to.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public void copyAndSetUpNewLog(java.io.File newLog, boolean handleOutOfMemoryError) throws java.io.IOException
handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.
java.io.IOException
public void log(java.lang.String string, boolean handleOutOfMemoryError)
string
- The message to log.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public void log(int logIndentation, java.lang.String string, boolean handleOutOfMemoryError)
logIndentation
- The indentation of string.string
- The message to log.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.protected void log(int logIndentation, java.lang.String string)
logIndentation
- The indentation of string.string
- The message to log.public final double distance(double x1, double y1, double x2, double y2, boolean handleOutOfMemoryError)
x1
- The x coordinte of one point.y1
- The y coordinte of one point.x2
- The x coordinte of another point.y2
- The y coordinte of another point.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final double distance(double x1, double y1, double x2, double y2, int nChunkCols, int _ChunkRowIndex, int _ChunkColIndex, boolean handleOutOfMemoryError)
x1
- The x coordinte of one point.y1
- The y coordinte of one point.x2
- The x coordinte of another point.y2
- The y coordinte of another point.nChunkCols
- The number of Grid2DSquareCellChunkAbstract columns in
theAbstractGrid2DSquareCelll that's Grid2DSquareCellChunkAbstract could
be swapped if an OutOfMemoryError is thrown._ChunkRowIndex
- The chunk row index of the
Grid2DSquareCellChunkAbstract not to be swapped if an OutOfMemoryError
is thrown._ChunkColIndex
- The chunk column index of the
Grid2DSquareCellChunkAbstract not to be swapped if an OutOfMemoryError
is thrown.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.protected final double distance(double x1, double y1, double x2, double y2)
x1
- The x coordinte of one point.y1
- The y coordinte of one point.x2
- The x coordinte of another point.y2
- The y coordinte of another point.public final double angle(double x1, double y1, double x2, double y2, boolean handleOutOfMemoryError)
x1
- The x coordinte of one point.y1
- The y coordinte of one point.x2
- The x coordinte of another point.y2
- The y coordinte of another point.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught in this method and swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public final double angle(double x1, double y1, double x2, double y2, int nChunkCols, int _ChunkRowIndex, int _ChunkColIndex, boolean handleOutOfMemoryError)
x1
- The x coordinte of one point.y1
- The y coordinte of one point.x2
- The x coordinte of another point.y2
- The y coordinte of another point.nChunkCols
- The number of Grid2DSquareCellChunkAbstract columns in
theAbstractGrid2DSquareCelll that's Grid2DSquareCellChunkAbstract could
be swapped if an OutOfMemoryError is thrown._ChunkRowIndex
- The chunk row index of the
Grid2DSquareCellChunkAbstract not to be swapped if an OutOfMemoryError
is thrown._ChunkColIndex
- The chunk column index of the
Grid2DSquareCellChunkAbstract not to be swapped if an OutOfMemoryError
is thrown.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught in this method and swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.protected final double angle(double x1, double y1, double x2, double y2)
x1
- The x coordinte of one point.y1
- The y coordinte of one point.x2
- The x coordinte of another point.y2
- The y coordinte of another point.public void mask(AbstractGrid2DSquareCell grid, AbstractGrid2DSquareCell mask, boolean handleOutOfMemoryError)
grid
- TheAbstractGrid2DSquareCelll that masked.mask
- TheAbstractGrid2DSquareCelll to use as a mask.public void mask(AbstractGrid2DSquareCell grid, double min, double max, boolean handleOutOfMemoryError)
grid
- The Grid2DSquareCellDouble to be masked.min
- The minimum value in the range.max
- The maximum value in the range.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public void mask(AbstractGrid2DSquareCell grid, double xmin, double ymin, double xmax, double ymax, boolean handleOutOfMemoryError)
grid
- TheAbstractGrid2DSquareCelll to be maskedxmin
- The minimum x-coordinate of the masking rectangle.ymin
- The minimum y-coordinate of the masking rectangle.xmax
- The maximum x-coordinate of the masking rectangle.ymax
- The maximum y-coordinate of the masking rectangle.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public void mask(AbstractGrid2DSquareCell grid, long startRowIndex, long startColIndex, long endRowIndex, long endColIndex, boolean handleOutOfMemoryError)
grid
- the Grid2DSquareCellDouble to be maskedstartRowIndex
- the index of the first row to be maskedstartColIndex
- the index of the first column to be maskedendRowIndex
- the index of the final row to be maskedendColIndex
- the index of the final column to be maskedhandleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public Grid2DSquareCellDouble _Rescale(AbstractGrid2DSquareCell _InputGrid, java.lang.String type, double min, double max, boolean handleOutOfMemoryError)
grid
- the Grid2DSquareCellDouble to be processed.type
- If type == null then a linear rescale is done.
If type == "log" then a log rescale is done.min
- The minimum value in the rescaled range.max
- The maximum value in the rescaled range.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public void setValueALittleBitLarger(Grid2DSquareCellDouble grid, java.util.HashSet _CellIDs, boolean handleOutOfMemoryError)
grid
- The Grid2DSquareCellDouble to be processed._CellIDs
- The CellIDs of the cells to be processed.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public void setValueALittleBitSmaller(Grid2DSquareCellDouble grid, java.util.HashSet _CellIDs, boolean handleOutOfMemoryError)
grid
- The Grid2DSquareCellDouble to be processed._CellIDs
- The CellIDs of the cells to be processed.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public void addToGrid(Grid2DSquareCellDouble grid, java.util.HashSet _CellIDs, double value, boolean handleOutOfMemoryError)
grid
- The Grid2DSquareCellDouble to be processed_CellIDs
- A HashSet containing CellIDs.value
- The value to be added.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught in this method
then swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public void addToGrid(Grid2DSquareCellDouble grid, double value, boolean handleOutOfMemoryError)
grid
- The Grid2DSquareCellDouble to be processedvalue
- The value to be addedhandleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public void addToGrid(Grid2DSquareCellDouble grid, AbstractGrid2DSquareCell.CellID[] _CellIDs, double value, boolean handleOutOfMemoryError)
grid
- The Grid2DSquareCellDouble to be processed_CellIDs
- Array of CellIDs.value
- The value to be added.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught in this method
then swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public void addToGrid(Grid2DSquareCellDouble grid, Grid2DSquareCellDouble gridToAdd, boolean handleOutOfMemoryError)
grid
- The Grid2DSquareCellDouble to be processed/modified.gridToAdd
- The Grid2DSquareCellDouble from which values are
added.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught in this method
then swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public void addToGrid(Grid2DSquareCellDouble grid, Grid2DSquareCellDouble gridToAdd, double weight, boolean handleOutOfMemoryError)
grid
- The Grid2DSquareCellDouble to be processed/modified.gridToAdd
- The Grid2DSquareCellDouble from which values are
added.weight
- The value gridToAdd values are multiplied
by.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught in this method
then swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public void addToGrid(Grid2DSquareCellDouble grid, Grid2DSquareCellDouble gridToAdd, long startRowIndex, long startColIndex, long endRowIndex, long endColIndex, double weight, boolean handleOutOfMemoryError)
grid
- The Grid2DSquareCellDouble to be processed.gridToAdd
- The Grid2DSquareCellDouble from which
values are added.startRowIndex
- The index of the first row from which
gridToAdd values are added.startColIndex
- the index of the first column from which
gridToAdd values are added.endRowIndex
- the index of the final row from which
gridToAdd values are added.endColIndex
- the index of the final column from which
gridToAdd values are added.weight
- The value gridToAdd values are multiplied
by.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught in this method
then swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public void addToGrid(Grid2DSquareCellDouble grid, Grid2DSquareCellDouble gridToAdd, long startRowIndex, long startColIndex, long endRowIndex, long endColIndex, java.math.BigDecimal[] dimensionConstraints, double weight, boolean handleOutOfMemoryError)
grid
- The Grid2DSquareCellDouble to be processed.gridToAdd
- The Grid2DSquareCellDouble from which
values are added.startRowIndex
- The index of the first row from which
gridToAdd values are added.startColIndex
- The index of the first column from which
gridToAdd values are added.endRowIndex
- The index of the final row from which
gridToAdd values are added.endColIndex
- The index of the final column from which
gridToAdd values are added.dimensionConstraints
- weight
- The value gridToAdd values are multiplied
by.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.
TODO: Check that reasonable answers are returned for intersections and aggregations.public void addToGrid(Grid2DSquareCellDouble grid, java.io.File file, java.lang.String type, boolean handleOutOfMemoryError)
grid
- the Grid2DSquareCellDouble to be processedfile
- the file contining values to be added.type
- the type of file.
Supported types include "xyv", "xy", "idxy" )handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.public Grid2DSquareCellDouble aggregate(AbstractGrid2DSquareCell grid, int cellFactor, java.lang.String statistic, int rowOffset, int colOffset, Grid2DSquareCellDoubleFactory gridFactory, boolean handleOutOfMemoryError)
grid
- the Grid2DSquareCellDouble to be processedcellFactor
- the number of times wider/higher the aggregated grid
cells are to bestatistic
- "sum", "mean", "max", or "min" depending on what
aggregate of values are wantedrowOffset
- the number of rows above or below the origin of grid
where the aggregation is to start.
> 0 result yllcorner will be above grid yllcorner
< 0 result yllcorner will be below grid yllcornercolOffset
- the number of columns above or below the origin of grid
where the aggregation is to start.
> 0 result xllcorner will be right of grid xllcorner
< 0 result xllcorner will be left of grid xllcornergridFactory
- the Abstract2DSquareCellDoubleFactory used to create
result and temporary AbstractGrid2DSquareCellDoubles.handleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.
NB. In the calculation of the sum and the mean if there is a cell in grid which has a data value then
the result which incorporates that cell has a data value. For this result cell, any of the cells in
grid which have noDataValues their value is taken as that of the average of its nearest cells with
a value.
In the calculation of the max and the min noDataValues are simply ignored.
Formerly noDataValues were treated as the average of values within a result cell.
TODO:
implement median, mode and variance aggregations.public Grid2DSquareCellDouble aggregate(AbstractGrid2DSquareCell grid, java.lang.String statistic, java.math.BigDecimal[] resultDimensions, Grid2DSquareCellDoubleFactory gridFactory, boolean handleOutOfMemoryError)
grid
- The Grid2DSquareCellDouble to be processedstatistic
- "sum", "mean", "max", or "min" depending on what aggregate of values are wantedresultDimensions
- gridFactory
- The Abstract2DSquareCellDoubleFactory used to create _AbstractGrid2DSquareCell_HashSethandleOutOfMemoryError
- If true then OutOfMemoryErrors are caught
in this method then swap operations are initiated prior to retrying.
If false then OutOfMemoryErrors are caught and thrown.
Use this aggregate method if result is to have a new spatial frame.
NB. In the calculation of the sum and the mean if there is a cell in grid which has a data value then
the result which incorporates that cell has a data value. For this result cell, any of the cells in
grid which have noDataValues their value is taken as that of the average of its nearest cells with
a value.
In the calculation of the max and the min noDataValues are simply ignored.
Formerly noDataValues were treated as the average of values within a result cell.
TODO:
implement median, mode and variance aggregations.
protected double[][] getRowProcessInitialData(Grid2DSquareCellDouble grid, int cellDistance, long row)
protected double[][] getRowProcessData(Grid2DSquareCellDouble grid, double[][] previous, int cellDistance, long row, long col)
public void _Output(AbstractGrid2DSquareCell _Grid2DSquareCell, java.io.File _Output_Directory, ImageExporter _ImageExporter, java.lang.String[] _ImageTypes, ESRIAsciiGridExporter _ESRIAsciiGridExporter, boolean handleOutOfMemoryError) throws java.io.IOException
_Grid2DSquareCell
- _Output_Directory
- _ImageExporter
- _ImageTypes
- _ESRIAsciiGridExporter
- handleOutOfMemoryError
-
java.io.IOException
public void _OutputImage(AbstractGrid2DSquareCell _Grid2DSquareCell, java.io.File _Output_Directory, ImageExporter _ImageExporter, java.lang.String[] _ImageTypes, boolean handleOutOfMemoryError) throws java.io.IOException
java.io.IOException
public void _OutputESRIAsciiGrid(AbstractGrid2DSquareCell _Grid2DSquareCell, java.io.File _Output_Directory, ESRIAsciiGridExporter _ESRIAsciiGridExporter, boolean handleOutOfMemoryError) throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |