|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.leeds.ccg.andyt.grids.core.OutOfMemoryErrorHandler
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 ).
Fields inherited from class uk.ac.leeds.ccg.andyt.grids.core.OutOfMemoryErrorHandler |
---|
_Grid2DSquareCells, _HandleOutOfMemoryErrorFalse, _HandleOutOfMemoryErrorTrue, _MemoryReserve, _Runtime |
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(java.util.HashSet _Grid2DSquareCells)
|
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)
|
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._Grid2DSquareCells. |
AbstractGrid2DSquareCell |
getGrid2DSquareCell(boolean _HandleOutOfMemoryError)
Returns a AbstractGrid2DSquareCell from this._Grid2DSquareCells. |
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)
|
Grid2DSquareCellDouble |
linearRescale(Grid2DSquareCellDouble grid,
double min,
double max,
boolean _HandleOutOfMemoryError)
Modifies grid so values are linearly rescaled into the range [min,max]. |
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) |
Grid2DSquareCellDouble |
logRescale(Grid2DSquareCellDouble grid,
double min,
double max,
boolean _HandleOutOfMemoryError)
Modifies grid so values are linearly scaled to range [1.0d,1000000.0d] then logged using Math.log(double) and then linearly scaled into the range [min,max] |
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(java.util.HashSet _Grid2DSquareCells)
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 masked_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 linearRescale(Grid2DSquareCellDouble grid, double min, double max, boolean _HandleOutOfMemoryError)
grid
- the Grid2DSquareCellDouble to be processed.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 Grid2DSquareCellDouble logRescale(Grid2DSquareCellDouble grid, double min, double max, boolean _HandleOutOfMemoryError)
grid
- the Grid2DSquareCellDouble to be processedmin
- the minimum value in the rescaled rangemax
- 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 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, 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 _Grid2DSquareCells_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.
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 |