uk.ac.leeds.ccg.andyt.grids.process
Class Grid2DSquareCellProcessorDEM

java.lang.Object
  extended by uk.ac.leeds.ccg.andyt.grids.process.Grid2DSquareCellProcessor
      extended by uk.ac.leeds.ccg.andyt.grids.process.Grid2DSquareCellProcessorDEM

public class Grid2DSquareCellProcessorDEM
extends Grid2DSquareCellProcessor

A class of methods relevant to the processing of Digital Elevation Model Data.


Field Summary
 
Fields inherited from class uk.ac.leeds.ccg.andyt.grids.process.Grid2DSquareCellProcessor
_Directory, _Grid2DSquareCellDoubleChunk64CellMapFactory, _Grid2DSquareCellDoubleChunkArrayFactory, _Grid2DSquareCellDoubleChunkFactory, _Grid2DSquareCellDoubleChunkJAIFactory, _Grid2DSquareCellDoubleChunkMapFactory, _Grid2DSquareCellDoubleChunkRAFFactory, _Grid2DSquareCellDoubleFactory, _Grid2DSquareCellIntChunk64CellMapFactory, _Grid2DSquareCellIntChunkArrayFactory, _Grid2DSquareCellIntChunkJAIFactory, _Grid2DSquareCellIntChunkMapFactory, _Grid2DSquareCellIntChunkRAFFactory, _Grid2DSquareCellIntFactory, _Grid2DSquareCelllIntChunkFactory, _GridStatistics, _GridStatistics0, _GridStatistics1, log, logIndentation, startTime
 
Constructor Summary
Grid2DSquareCellProcessorDEM()
          Creates a new Grid2DSquareCellProcessorDEM
Grid2DSquareCellProcessorDEM(java.io.File _Directory)
          Creates a new instance of Grid2DSquareCellProcessorDEM.
Grid2DSquareCellProcessorDEM(java.io.File _Directory, boolean appendToLogFile)
          Creates a new instance of Grid2DSquareCellProcessorDEM.
 
Method Summary
 Grid2DSquareCellDouble getHollowFilledDEM(AbstractGrid2DSquareCell _Grid2DSquareCell, Grid2DSquareCellDoubleFactory _Grid2DSquareCellDoubleFactory, double outflowHeight, int maxIterations, java.util.HashSet outflowCellIDsSet, boolean _TreatNoDataValueAsOutflow, boolean handleOutOfMemoryError)
           
 java.util.HashSet getInitialPeaksHashSetAndSetTheirValue(Grid2DSquareCellDouble grid, Grid2DSquareCellDouble upSlopeAreaMetrics, boolean handleOutOfMemoryError)
          Returns a HashSet containing _CellIDs which identifies cells for which neighbouring cells in the immediate 8 cell neighbourhood that are either the same value, lower or noDataValues
 Grid2DSquareCellDouble getMaxFlowDirection(Grid2DSquareCellDouble grid, Grid2DSquareCellDoubleFactory gridFactory, boolean handleOutOfMemoryError)
          Returns an Grid2DSquareCellDouble result containing values which indicate the direction of the maximum down slope for the immediate 8 cell neighbourhood.
 AbstractGrid2DSquareCell[] getMetrics1(AbstractGrid2DSquareCell[] metrics1, AbstractGrid2DSquareCell _Grid2DSquareCell, java.math.BigDecimal[] dimensions, double distance, double weightIntersect, double weightFactor, boolean handleOutOfMemoryError)
          Returns an Grid2DSquareCellDouble[] metrics1 where: \n metrics1[0] = no data count; \n metrics1[1] = flatness; \n metrics1[2] = roughness; \n metrics1[3] = slopyness; \n metrics1[4] = levelness; \n metrics1[5] = totalDownness; \n metrics1[6] = averageDownness; \n metrics1[7] = totalUpness; \n metrics1[8] = averageUpness; \n metrics1[9] = maxd_hhhh [ sum of distance weighted maximum height differences ]; \n metrics1[10] = mind_hhhh [ sum of distance weighted minimum height differences ]; \n metrics1[11] = sumd_hhhh [ sum of distance weighted height differences ]; \n metrics1[12] = aved_hhhh [ sum of distance weighted average height difference ]; \n metrics1[13] = count_hhhh [ count ]; \n metrics1[14] = w_hhhh [ sum of distance weights ]; \n metrics1[15] = mind_hxhx_ai_hhhl [ sum of distance weighted ( minimum difference of cells adjacent to lower cell ) ]; \n metrics1[16] = maxd_hxhx_ai_hhhl [ sum of distance weighted ( maximum difference of cells adjacent to lower cell ) ]; \n metrics1[17] = sumd_hxhx_ai_hhhl [ sum of distance weighted ( sum of differences of cells adjacent to lower cell ) ]; \n metrics1[18] = d_xhxx_ai_hhhl [ sum of distance weighted ( difference of cell opposite lower cell ) ]; \n metrics1[19] = d_xxxl_ai_hhhl [ sum of distance weighted ( difference of lower cell ) ]; \n metrics1[20] = sumd_xhxl_ai_hhhl [ sum of distance weighted ( sum of differences of lower cell and cell opposite ) ]; \n metrics1[21] = mind_abs_xhxl_ai_hhhl [ sum of distance weighted ( minimum difference magnitude of lower cell and cell opposite ) ]; \n metrics1[22] = maxd_abs_xhxl_ai_hhhl [ sum of distance weighted ( maximum difference magnitude of lower cell and cell opposite ) ]; \n metrics1[23] = sumd_abs_xhxl_ai_hhhl [ sum of distance weighted ( sum of difference magnitudes of lower cell and cell opposite ) ]; \n metrics1[24] = count_hhhl [ count ]; \n metrics1[25] = w_hhhl [ sum of distance weights ]; \n metrics1[26] = mind_hxhx_ai_hlhl [ sum of distance weighted ( minimum difference of higher cells ) ]; \n metrics1[27] = maxd_hxhx_ai_hlhl [ sum of distance weighted ( maximum difference of higher cells ) ]; \n metrics1[28] = sumd_hxhx_ai_hlhl [ sum of distance weighted ( sum differences of higher cells ) ]; \n metrics1[29] = mind_xlxl_ai_hlhl [ sum of distance weighted ( minimum difference of lower cells ) ]; \n metrics1[30] = maxd_xlxl_ai_hlhl [ sum of distance weighted ( maximum difference of lower cells ) ]; \n metrics1[31] = sumd_xlxl_ai_hlhl [ sum of distance weighted ( sum of differences of lower cells ) ]; \n metrics1[32] = mind_abs_hlhl [ sum of distance weighted ( minimum difference magnitude of cells ) ]; \n metrics1[33] = maxd_abs_hlhl [ sum of distance weighted ( maximum difference magnitude of cells ) ]; \n metrics1[34] = sumd_abs_hlhl [ sum of distance weighted ( sum of difference magnitudes of cells ) ]; \n metrics1[35] = count_hlhl [ count ]; \n metrics1[36] = w_hlhl [ sum of distance weights ]; \n metrics1[37] = mind_hhxx_ai_hhll [ sum of distance weighted ( minimum difference of higher cells ) ]; \n metrics1[38] = maxd_hhxx_ai_hhll [ sum of distance weighted ( maximum difference of higher cells ) ]; \n metrics1[39] = sumd_hhxx_ai_hhll [ sum of distance weighted ( sum of differences of higher cells ) ]; \n metrics1[40] = mind_xxll_ai_hhll [ sum of distance weighted ( minimum difference of lower cells ) ]; \n metrics1[41] = maxd_xxll_ai_hhll [ sum of distance weighted ( maximum difference of lower cells ) ]; \n metrics1[42] = sumd_xxll_ai_hhll [ sum of distance weighted ( sum of differences of lower cells ) ]; \n metrics1[43] = mind_abs_hhll [ sum of distance weighted ( minimum difference magnitude of cells ) ]; \n metrics1[44] = maxd_abs_hhll [ sum of distance weighted ( maximum difference magnitude of cells ) ]; \n metrics1[45] = sumd_abs_hhll [ sum of distance weighted ( sum of difference magnitudes of cells ) ]; \n metrics1[46] = count_hhll [ count ]; \n metrics1[47] = w_hhll [ sum of distance weights ]; \n metrics1[48] = mind_lxlx_ai_lllh [ sum of distance weighted ( minimum difference of cells adjacent to higher cell ) ]; \n metrics1[49] = maxd_lxlx_ai_lllh [ sum of distance weighted ( maximum difference of cells adjacent to higher cell ) ]; \n metrics1[50] = sumd_lxlx_ai_lllh [ sum of distance weighted ( sum of differences of cells adjacent to higher cell ) ]; \n metrics1[51] = d_xlxx_ai_lllh [ sum of distance weighted ( difference of cell opposite higher cell ) ]; \n metrics1[52] = d_xxxh_ai_lllh [ sum of distance weighted ( difference of higher cell ) ]; \n metrics1[53] = sumd_xlxh_ai_lllh [ sum of distance weighted ( sum of differences of higher cell and cell opposite ) ]; \n metrics1[54] = mind_abs_xlxh_ai_lllh [ sum of distance weighted ( minimum difference magnitude of higher cell and cell opposite ) ]; \n metrics1[55] = maxd_abs_xlxh_ai_lllh [ sum of distance weighted ( maximum difference magnitude of higher cell and cell opposite ) ]; \n metrics1[56] = sumd_abs_xlxh_ai_lllh [ sum of distance weighted ( sum of difference magnitudes of higher cell and cell opposite ) ]; \n metrics1[57] = count_lllh [ count ]; \n metrics1[58] = w_lllh [ sum of distance weights ]; \n metrics1[59] = maxd_llll [ sum of distance weighted maximum height differences ]; \n metrics1[60] = mind_llll [ sum of distance weighted minimum height differences ]; \n metrics1[61] = sumd_llll [ sum of distance weighted height differences ]; \n metrics1[62] = aved_llll [ sum of distance weighted average height difference ]; \n metrics1[63] = count_llll [ count ]; \n metrics1[64] = w_llll [ sum of distance weights ]; \n
 AbstractGrid2DSquareCell[] getMetrics1(AbstractGrid2DSquareCell _Grid2DSquareCell, double distance, double weightIntersect, double weightFactor, Grid2DSquareCellDoubleFactory _Grid2DSquareCellDoubleFactory, Grid2DSquareCellIntFactory _Grid2DSquareCellIntFactory, boolean handleOutOfMemoryError)
          Returns an Grid2DSquareCellDouble[] metrics1 where: metrics1[0] = no data count; metrics1[1] = flatness; metrics1[2] = roughness; metrics1[3] = slopyness; metrics1[4] = levelness; metrics1[5] = totalDownness; metrics1[6] = averageDownness; metrics1[7] = totalUpness; metrics1[8] = averageUpness; metrics1[9] = maxd_hhhh [ sum of distance weighted maximum height differences ]; metrics1[10] = mind_hhhh [ sum of distance weighted minimum height differences ]; metrics1[11] = sumd_hhhh [ sum of distance weighted height differences ]; metrics1[12] = aved_hhhh [ sum of distance weighted average height difference ]; metrics1[13] = count_hhhh [ count ]; metrics1[14] = w_hhhh [ sum of distance weights ]; metrics1[15] = mind_hxhx_ai_hhhl [ sum of distance weighted ( minimum difference of cells adjacent to lower cell ) ]; metrics1[16] = maxd_hxhx_ai_hhhl [ sum of distance weighted ( maximum difference of cells adjacent to lower cell ) ]; metrics1[17] = sumd_hxhx_ai_hhhl [ sum of distance weighted ( sum of differences of cells adjacent to lower cell ) ]; metrics1[18] = d_xhxx_ai_hhhl [ sum of distance weighted ( difference of cell opposite lower cell ) ]; metrics1[19] = d_xxxl_ai_hhhl [ sum of distance weighted ( difference of lower cell ) ]; metrics1[20] = sumd_xhxl_ai_hhhl [ sum of distance weighted ( sum of differences of lower cell and cell opposite ) ]; metrics1[21] = mind_abs_xhxl_ai_hhhl [ sum of distance weighted ( minimum difference magnitude of lower cell and cell opposite ) ]; metrics1[22] = maxd_abs_xhxl_ai_hhhl [ sum of distance weighted ( maximum difference magnitude of lower cell and cell opposite ) ]; metrics1[23] = sumd_abs_xhxl_ai_hhhl [ sum of distance weighted ( sum of difference magnitudes of lower cell and cell opposite ) ]; metrics1[24] = count_hhhl [ count ]; metrics1[25] = w_hhhl [ sum of distance weights ]; metrics1[26] = mind_hxhx_ai_hlhl [ sum of distance weighted ( minimum difference of higher cells ) ]; metrics1[27] = maxd_hxhx_ai_hlhl [ sum of distance weighted ( maximum difference of higher cells ) ]; metrics1[28] = sumd_hxhx_ai_hlhl [ sum of distance weighted ( sum differences of higher cells ) ]; metrics1[29] = mind_xlxl_ai_hlhl [ sum of distance weighted ( minimum difference of lower cells ) ]; metrics1[30] = maxd_xlxl_ai_hlhl [ sum of distance weighted ( maximum difference of lower cells ) ]; metrics1[31] = sumd_xlxl_ai_hlhl [ sum of distance weighted ( sum of differences of lower cells ) ]; metrics1[32] = mind_abs_hlhl [ sum of distance weighted ( minimum difference magnitude of cells ) ]; metrics1[33] = maxd_abs_hlhl [ sum of distance weighted ( maximum difference magnitude of cells ) ]; metrics1[34] = sumd_abs_hlhl [ sum of distance weighted ( sum of difference magnitudes of cells ) ]; metrics1[35] = count_hlhl [ count ]; metrics1[36] = w_hlhl [ sum of distance weights ]; metrics1[37] = mind_hhxx_ai_hhll [ sum of distance weighted ( minimum difference of higher cells ) ]; metrics1[38] = maxd_hhxx_ai_hhll [ sum of distance weighted ( maximum difference of higher cells ) ]; metrics1[39] = sumd_hhxx_ai_hhll [ sum of distance weighted ( sum of differences of higher cells ) ]; metrics1[40] = mind_xxll_ai_hhll [ sum of distance weighted ( minimum difference of lower cells ) ]; metrics1[41] = maxd_xxll_ai_hhll [ sum of distance weighted ( maximum difference of lower cells ) ]; metrics1[42] = sumd_xxll_ai_hhll [ sum of distance weighted ( sum of differences of lower cells ) ]; metrics1[43] = mind_abs_hhll [ sum of distance weighted ( minimum difference magnitude of cells ) ]; metrics1[44] = maxd_abs_hhll [ sum of distance weighted ( maximum difference magnitude of cells ) ]; metrics1[45] = sumd_abs_hhll [ sum of distance weighted ( sum of difference magnitudes of cells ) ]; metrics1[46] = count_hhll [ count ]; metrics1[47] = w_hhll [ sum of distance weights ]; metrics1[48] = mind_lxlx_ai_lllh [ sum of distance weighted ( minimum difference of cells adjacent to higher cell ) ]; metrics1[49] = maxd_lxlx_ai_lllh [ sum of distance weighted ( maximum difference of cells adjacent to higher cell ) ]; metrics1[50] = sumd_lxlx_ai_lllh [ sum of distance weighted ( sum of differences of cells adjacent to higher cell ) ]; metrics1[51] = d_xlxx_ai_lllh [ sum of distance weighted ( difference of cell opposite higher cell ) ]; metrics1[52] = d_xxxh_ai_lllh [ sum of distance weighted ( difference of higher cell ) ]; metrics1[53] = sumd_xlxh_ai_lllh [ sum of distance weighted ( sum of differences of higher cell and cell opposite ) ]; metrics1[54] = mind_abs_xlxh_ai_lllh [ sum of distance weighted ( minimum difference magnitude of higher cell and cell opposite ) ]; metrics1[55] = maxd_abs_xlxh_ai_lllh [ sum of distance weighted ( maximum difference magnitude of higher cell and cell opposite ) ]; metrics1[56] = sumd_abs_xlxh_ai_lllh [ sum of distance weighted ( sum of difference magnitudes of higher cell and cell opposite ) ]; metrics1[57] = count_lllh [ count ]; metrics1[58] = w_lllh [ sum of distance weights ]; metrics1[59] = maxd_llll [ sum of distance weighted maximum height differences ]; metrics1[60] = mind_llll [ sum of distance weighted minimum height differences ]; metrics1[61] = sumd_llll [ sum of distance weighted height differences ]; metrics1[62] = aved_llll [ sum of distance weighted average height difference ]; metrics1[63] = count_llll [ count ]; metrics1[64] = w_llll [ sum of distance weights ];
protected  java.lang.String[] getMetrics1Names()
          TODO
 Grid2DSquareCellDouble[] getMetrics2(Grid2DSquareCellDouble grid, double distance, double weightIntersect, double weightFactor, int samplingDensity, Grid2DSquareCellDoubleFactory gridFactory, boolean handleOutOfMemoryError)
          Returns an Grid2DSquareCellDouble[] metrics2 where: TODO: metrics2 is a mess.
 double[][] getNormalDistributionKernelWeights(AbstractGrid2DSquareCell a_Grid2DSquareCell, double distance, boolean handleOutOfMemoryError)
           
protected  Grid2DSquareCellDouble[] getSlopeAspect(AbstractGrid2DSquareCell _Grid2DSquareCell)
          Calculates and returns measures of the slope and aspect for the AbstractGrid2DSquareCell _Grid2DSquareCell passed in.
 Grid2DSquareCellDouble[] getSlopeAspect(AbstractGrid2DSquareCell _Grid2DSquareCell, boolean handleOutOfMemoryError)
          Calculates and returns measures of the slope and aspect for the AbstractGrid2DSquareCell _Grid2DSquareCell passed in.
 Grid2DSquareCellDouble[] getSlopeAspect(AbstractGrid2DSquareCell _Grid2DSquareCell, double distance, double weightIntersect, double weightFactor, boolean handleOutOfMemoryError)
           
protected  double[] getSlopeAspect(AbstractGrid2DSquareCell _Grid2DSquareCell, double x, double y, double distance, double weightIntersect, double weightFactor, boolean handleOutOfMemoryError)
          Returns a double[] _SlopeAndAspect where: _SlopeAndAspect[0] is the aggregate slope over the region weighted by distance, weightIntersect and weightFactor; _SlopeAndAspect[1] is the aggregate aspect over the region weighted by distance, weightIntersect and weightFactor.
protected  double[] getSlopeAspect(AbstractGrid2DSquareCell _Grid2DSquareCell, long rowIndex, long colIndex, double distance, double weightIntersect, double weightFactor, boolean handleOutOfMemoryError)
          Returns a double[] _SlopeAndAspect where: _SlopeAndAspect[0] is the aggregate slope over the region weighted by distance, weightIntersect and weightFactor; _SlopeAndAspect[1] is the aggregate aspect over the region weighted by distance, weightIntersect and weightFactor.
protected  double[] getSlopeAspect(AbstractGrid2DSquareCell _Grid2DSquareCell, long rowIndex, long colIndex, double x, double y, double distance, double weightIntersect, double weightFactor, boolean handleOutOfMemoryError)
          Returns a double[] _SlopeAndAspect where: _SlopeAndAspect[0] is the aggregate slope over the region weighted by distance, weightIntersect and weightFactor; _SlopeAndAspect[1] is the aggregate aspect over the region weighted by distance, weightIntersect and weightFactor.
 Grid2DSquareCellDouble getUpSlopeAreaMetrics(Grid2DSquareCellDouble grid, double distance, double weightFactor, double weightIntersect, Grid2DSquareCellDoubleFactory gridFactory, boolean handleOutOfMemoryError)
          Returns an Grid2DSquareCellDouble[] each element of which corresponds to a metrics of up slope cells of grid - a DEM The steeper the slope the higher the runoff?
 
Methods inherited from class uk.ac.leeds.ccg.andyt.grids.process.Grid2DSquareCellProcessor
_Output, _OutputESRIAsciiGrid, _OutputImage, _Rescale, addToGrid, addToGrid, addToGrid, addToGrid, addToGrid, addToGrid, addToGrid, addToGrid, aggregate, aggregate, angle, angle, angle, copyAndSetUpNewLog, distance, distance, distance, get_Directory, getGrid2DSquareCell, getGrid2DSquareCell, getRowProcessData, getRowProcessInitialData, getTime0, getTime0, log, log, log, mask, mask, mask, mask, set_Directory, set_Directory, set_Directory, setValueALittleBitLarger, setValueALittleBitSmaller
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Grid2DSquareCellProcessorDEM

public Grid2DSquareCellProcessorDEM()
Creates a new Grid2DSquareCellProcessorDEM


Grid2DSquareCellProcessorDEM

public Grid2DSquareCellProcessorDEM(java.io.File _Directory)
Creates a new instance of Grid2DSquareCellProcessorDEM. By default the logs are appended to the end of the log _File if it exists. To overwrite the log _File use: Grid2DSquareCellDoubleProcessor( _Directory, false );

Parameters:
_Directory -

Grid2DSquareCellProcessorDEM

public Grid2DSquareCellProcessorDEM(java.io.File _Directory,
                                    boolean appendToLogFile)
Creates a new instance of Grid2DSquareCellProcessorDEM. The log file in _Directory will be overwritten if appendToLogFile is false.

Parameters:
_Directory -
appendToLogFile -
Method Detail

getSlopeAspect

public Grid2DSquareCellDouble[] getSlopeAspect(AbstractGrid2DSquareCell _Grid2DSquareCell,
                                               boolean handleOutOfMemoryError)
                                        throws java.io.IOException
Calculates and returns measures of the slope and aspect for the AbstractGrid2DSquareCell _Grid2DSquareCell passed in.

Parameters:
_Grid2DSquareCell - The AbstractGrid2DSquareCell to be processed.
handleOutOfMemoryError - If true then OutOfMemoryErrors are caught in this method then caching operations are initiated prior to retrying. If false then OutOfMemoryErrors are caught and thrown. Defaults: kernel to have distance = ( _Grid2DSquareCell.get_Dimensions( handleOutOfMemoryError )[ 0 ].doubleValue() ) * ( 3.0d / 2.0d ); weightIntersect = 1.0d; weightFactor = 0.0d;
Returns:
Grid2DSquareCellDouble[] _SlopeAndAspect.
Throws:
java.io.IOException

getSlopeAspect

protected Grid2DSquareCellDouble[] getSlopeAspect(AbstractGrid2DSquareCell _Grid2DSquareCell)
                                           throws java.io.IOException
Calculates and returns measures of the slope and aspect for the AbstractGrid2DSquareCell _Grid2DSquareCell passed in.

Parameters:
_Grid2DSquareCell - The AbstractGrid2DSquareCell to be processed. Defaults: kernel to have distance = ( _Grid2DSquareCell.get_Dimensions( handleOutOfMemoryError )[ 0 ].doubleValue() ) * ( 3.0d / 2.0d ); weightIntersect = 1.0d; weightFactor = 0.0d;
Returns:
Grid2DSquareCellDouble[] _SlopeAndAspect. /n
Throws:
java.io.IOException

getNormalDistributionKernelWeights

public double[][] getNormalDistributionKernelWeights(AbstractGrid2DSquareCell a_Grid2DSquareCell,
                                                     double distance,
                                                     boolean handleOutOfMemoryError)

getSlopeAspect

public Grid2DSquareCellDouble[] getSlopeAspect(AbstractGrid2DSquareCell _Grid2DSquareCell,
                                               double distance,
                                               double weightIntersect,
                                               double weightFactor,
                                               boolean handleOutOfMemoryError)
                                        throws java.io.IOException
Parameters:
_Grid2DSquareCell - The AbstractGrid2DSquareCell to be processed.
distance - the distance which defines the aggregate region.
weightIntersect - The kernel weighting weight at centre.
weightFactor - The kernel weighting distance decay.
handleOutOfMemoryError - If true then OutOfMemoryErrors are caught in this method then caching operations are initiated prior to retrying. If false then OutOfMemoryErrors are caught and thrown. (NB. There are various strategies to reduce bias caused by noDataValues. Here: If the cell in grid for which _SlopeAndAspect is being calculated is a noDataValue then the cells in _SlopeAndAspect are assigned their noDataValue. If one of the cells in the calculation of slope and aspect is a noDataValue then its height is taken as the nearest cell value. (Formerly the difference in its height was taken as the average difference in height for those cells with values.) )
Returns:
Grid2DSquareCellDouble[] _SlopeAndAspect where: _SlopeAndAspect[0] Is the distance weighted aggregate slope over the region. This is normalised by the sum of the weights used and the average distance to give a proportional measure. _SlopeAndAspect[1] Is the distance weighted aggregate aspect over the region. This is the clockwize angle from the y axis (usually North). _SlopeAndAspect[2] Is the sine of _SlopeAndAspect[1]. _SlopeAndAspect[3] Is the sine of _SlopeAndAspect[1] + ( ( Pi * 1 ) / 8). _SlopeAndAspect[4] Is the sine of _SlopeAndAspect[1] + ( ( Pi * 2 ) / 8). _SlopeAndAspect[5] Is the sine of _SlopeAndAspect[1] + ( ( Pi * 3 ) / 8). _SlopeAndAspect[6] Is the sine of _SlopeAndAspect[1] + ( ( Pi * 4 ) / 8). _SlopeAndAspect[7] Is the sine of _SlopeAndAspect[1] + ( ( Pi * 5 ) / 8). _SlopeAndAspect[8] Is the sine of _SlopeAndAspect[1] + ( ( Pi * 6 ) / 8). _SlopeAndAspect[9] Is the sine of _SlopeAndAspect[1] + ( ( Pi * 7 ) / 8).
Throws:
java.io.IOException

getSlopeAspect

protected double[] getSlopeAspect(AbstractGrid2DSquareCell _Grid2DSquareCell,
                                  long rowIndex,
                                  long colIndex,
                                  double distance,
                                  double weightIntersect,
                                  double weightFactor,
                                  boolean handleOutOfMemoryError)
Returns a double[] _SlopeAndAspect where: _SlopeAndAspect[0] is the aggregate slope over the region weighted by distance, weightIntersect and weightFactor; _SlopeAndAspect[1] is the aggregate aspect over the region weighted by distance, weightIntersect and weightFactor. This is the clockwize angle from north. _SlopeAndAspect[2] is the aggregate aspect over the region weighted by distance, weightIntersect and weightFactor. This is the sine of the clockwize angle from north. _SlopeAndAspect[3] is the aggregate aspect over the region weighted by distance, weightIntersect and weightFactor. This is the cosine of the clockwize angle from north.

Parameters:
_Grid2DSquareCell - the Grid2DSquareCellDouble to be processed.
rowIndex - the rowIndex where _SlopeAndAspect is calculated.
colIndex - the colIndex where _SlopeAndAspect is calculated.
distance - the distance which defines the aggregate region.
weightIntersect - the kernel weighting weight at centre.
weightFactor - the kernel weighting distance decay.

getSlopeAspect

protected double[] getSlopeAspect(AbstractGrid2DSquareCell _Grid2DSquareCell,
                                  double x,
                                  double y,
                                  double distance,
                                  double weightIntersect,
                                  double weightFactor,
                                  boolean handleOutOfMemoryError)
Returns a double[] _SlopeAndAspect where: _SlopeAndAspect[0] is the aggregate slope over the region weighted by distance, weightIntersect and weightFactor; _SlopeAndAspect[1] is the aggregate aspect over the region weighted by distance, weightIntersect and weightFactor. This is the clockwize angle from north. _SlopeAndAspect[2] is the aggregate aspect over the region weighted by distance, weightIntersect and weightFactor. This is the sine of the clockwize angle from north. _SlopeAndAspect[3] is the aggregate aspect over the region weighted by distance, weightIntersect and weightFactor. This is the cosine of the clockwize angle from north.

Parameters:
_Grid2DSquareCell - the Grid2DSquareCellDouble to be processed.
x - the x coordinate from where the aspect is calculated
y - the y coordinate from where the aspect is calculated
distance - the distance which defines the aggregate region.
weightIntersect - the kernel weighting weight at centre.
weightFactor - the kernel weighting distance decay.

getSlopeAspect

protected double[] getSlopeAspect(AbstractGrid2DSquareCell _Grid2DSquareCell,
                                  long rowIndex,
                                  long colIndex,
                                  double x,
                                  double y,
                                  double distance,
                                  double weightIntersect,
                                  double weightFactor,
                                  boolean handleOutOfMemoryError)
Returns a double[] _SlopeAndAspect where: _SlopeAndAspect[0] is the aggregate slope over the region weighted by distance, weightIntersect and weightFactor; _SlopeAndAspect[1] is the aggregate aspect over the region weighted by distance, weightIntersect and weightFactor. This is the clockwize angle from north. _SlopeAndAspect[2] is the aggregate aspect over the region weighted by distance, weightIntersect and weightFactor. This is the sine of the clockwize angle from north. _SlopeAndAspect[3] is the aggregate aspect over the region weighted by distance, weightIntersect and weightFactor. This is the cosine of the clockwize angle from north.

Parameters:
_Grid2DSquareCell - The Grid2DSquareCellDouble to be processed
rowIndex - the rowIndex where the result is calculated
colIndex - the colIndex where the result is calculated
x - the x coordinate from where the aspect is calculated
y - the y coordinate from where the aspect is calculated
distance - the distance which defines the region
weightIntersect -
weightFactor - NB. If grid.getCell( x, y ) == grid.get_NoDataValue() then; result[ 0 ] = grid.get_NoDataValue() result[ 1 ] = grid.get_NoDataValue() TODO: x and y can be offset from a cell centroid so consider interpolation

getHollowFilledDEM

public Grid2DSquareCellDouble getHollowFilledDEM(AbstractGrid2DSquareCell _Grid2DSquareCell,
                                                 Grid2DSquareCellDoubleFactory _Grid2DSquareCellDoubleFactory,
                                                 double outflowHeight,
                                                 int maxIterations,
                                                 java.util.HashSet outflowCellIDsSet,
                                                 boolean _TreatNoDataValueAsOutflow,
                                                 boolean handleOutOfMemoryError)
Parameters:
_Grid2DSquareCell - AbstractGrid2DSquareCell to be processed.
Returns:
Grid2DSquareCellDouble which has cell values as in _Grid2DSquareCell except with hollows raised. The attempt to raise hollows may not remove all hollows. The process of removing hollows works iteratively. Essentially, the algorithm is as follows:
  1. Identify all hollows.
  2. Raise all hollows by a small amount.
  3. Identify all hollows.
  4. Trace bottom of each hollow and raise to the height of the lowest cell around it.
  5. Repeat 2 to 5 until there are no hollows or until maxIterations reached.
This algorithm was optimised by processing each hollow in turn and dealing with the situation around each hollow.

getMetrics1

public AbstractGrid2DSquareCell[] getMetrics1(AbstractGrid2DSquareCell _Grid2DSquareCell,
                                              double distance,
                                              double weightIntersect,
                                              double weightFactor,
                                              Grid2DSquareCellDoubleFactory _Grid2DSquareCellDoubleFactory,
                                              Grid2DSquareCellIntFactory _Grid2DSquareCellIntFactory,
                                              boolean handleOutOfMemoryError)
                                       throws java.io.IOException
Returns an Grid2DSquareCellDouble[] metrics1 where: metrics1[0] = no data count; metrics1[1] = flatness; metrics1[2] = roughness; metrics1[3] = slopyness; metrics1[4] = levelness; metrics1[5] = totalDownness; metrics1[6] = averageDownness; metrics1[7] = totalUpness; metrics1[8] = averageUpness; metrics1[9] = maxd_hhhh [ sum of distance weighted maximum height differences ]; metrics1[10] = mind_hhhh [ sum of distance weighted minimum height differences ]; metrics1[11] = sumd_hhhh [ sum of distance weighted height differences ]; metrics1[12] = aved_hhhh [ sum of distance weighted average height difference ]; metrics1[13] = count_hhhh [ count ]; metrics1[14] = w_hhhh [ sum of distance weights ]; metrics1[15] = mind_hxhx_ai_hhhl [ sum of distance weighted ( minimum difference of cells adjacent to lower cell ) ]; metrics1[16] = maxd_hxhx_ai_hhhl [ sum of distance weighted ( maximum difference of cells adjacent to lower cell ) ]; metrics1[17] = sumd_hxhx_ai_hhhl [ sum of distance weighted ( sum of differences of cells adjacent to lower cell ) ]; metrics1[18] = d_xhxx_ai_hhhl [ sum of distance weighted ( difference of cell opposite lower cell ) ]; metrics1[19] = d_xxxl_ai_hhhl [ sum of distance weighted ( difference of lower cell ) ]; metrics1[20] = sumd_xhxl_ai_hhhl [ sum of distance weighted ( sum of differences of lower cell and cell opposite ) ]; metrics1[21] = mind_abs_xhxl_ai_hhhl [ sum of distance weighted ( minimum difference magnitude of lower cell and cell opposite ) ]; metrics1[22] = maxd_abs_xhxl_ai_hhhl [ sum of distance weighted ( maximum difference magnitude of lower cell and cell opposite ) ]; metrics1[23] = sumd_abs_xhxl_ai_hhhl [ sum of distance weighted ( sum of difference magnitudes of lower cell and cell opposite ) ]; metrics1[24] = count_hhhl [ count ]; metrics1[25] = w_hhhl [ sum of distance weights ]; metrics1[26] = mind_hxhx_ai_hlhl [ sum of distance weighted ( minimum difference of higher cells ) ]; metrics1[27] = maxd_hxhx_ai_hlhl [ sum of distance weighted ( maximum difference of higher cells ) ]; metrics1[28] = sumd_hxhx_ai_hlhl [ sum of distance weighted ( sum differences of higher cells ) ]; metrics1[29] = mind_xlxl_ai_hlhl [ sum of distance weighted ( minimum difference of lower cells ) ]; metrics1[30] = maxd_xlxl_ai_hlhl [ sum of distance weighted ( maximum difference of lower cells ) ]; metrics1[31] = sumd_xlxl_ai_hlhl [ sum of distance weighted ( sum of differences of lower cells ) ]; metrics1[32] = mind_abs_hlhl [ sum of distance weighted ( minimum difference magnitude of cells ) ]; metrics1[33] = maxd_abs_hlhl [ sum of distance weighted ( maximum difference magnitude of cells ) ]; metrics1[34] = sumd_abs_hlhl [ sum of distance weighted ( sum of difference magnitudes of cells ) ]; metrics1[35] = count_hlhl [ count ]; metrics1[36] = w_hlhl [ sum of distance weights ]; metrics1[37] = mind_hhxx_ai_hhll [ sum of distance weighted ( minimum difference of higher cells ) ]; metrics1[38] = maxd_hhxx_ai_hhll [ sum of distance weighted ( maximum difference of higher cells ) ]; metrics1[39] = sumd_hhxx_ai_hhll [ sum of distance weighted ( sum of differences of higher cells ) ]; metrics1[40] = mind_xxll_ai_hhll [ sum of distance weighted ( minimum difference of lower cells ) ]; metrics1[41] = maxd_xxll_ai_hhll [ sum of distance weighted ( maximum difference of lower cells ) ]; metrics1[42] = sumd_xxll_ai_hhll [ sum of distance weighted ( sum of differences of lower cells ) ]; metrics1[43] = mind_abs_hhll [ sum of distance weighted ( minimum difference magnitude of cells ) ]; metrics1[44] = maxd_abs_hhll [ sum of distance weighted ( maximum difference magnitude of cells ) ]; metrics1[45] = sumd_abs_hhll [ sum of distance weighted ( sum of difference magnitudes of cells ) ]; metrics1[46] = count_hhll [ count ]; metrics1[47] = w_hhll [ sum of distance weights ]; metrics1[48] = mind_lxlx_ai_lllh [ sum of distance weighted ( minimum difference of cells adjacent to higher cell ) ]; metrics1[49] = maxd_lxlx_ai_lllh [ sum of distance weighted ( maximum difference of cells adjacent to higher cell ) ]; metrics1[50] = sumd_lxlx_ai_lllh [ sum of distance weighted ( sum of differences of cells adjacent to higher cell ) ]; metrics1[51] = d_xlxx_ai_lllh [ sum of distance weighted ( difference of cell opposite higher cell ) ]; metrics1[52] = d_xxxh_ai_lllh [ sum of distance weighted ( difference of higher cell ) ]; metrics1[53] = sumd_xlxh_ai_lllh [ sum of distance weighted ( sum of differences of higher cell and cell opposite ) ]; metrics1[54] = mind_abs_xlxh_ai_lllh [ sum of distance weighted ( minimum difference magnitude of higher cell and cell opposite ) ]; metrics1[55] = maxd_abs_xlxh_ai_lllh [ sum of distance weighted ( maximum difference magnitude of higher cell and cell opposite ) ]; metrics1[56] = sumd_abs_xlxh_ai_lllh [ sum of distance weighted ( sum of difference magnitudes of higher cell and cell opposite ) ]; metrics1[57] = count_lllh [ count ]; metrics1[58] = w_lllh [ sum of distance weights ]; metrics1[59] = maxd_llll [ sum of distance weighted maximum height differences ]; metrics1[60] = mind_llll [ sum of distance weighted minimum height differences ]; metrics1[61] = sumd_llll [ sum of distance weighted height differences ]; metrics1[62] = aved_llll [ sum of distance weighted average height difference ]; metrics1[63] = count_llll [ count ]; metrics1[64] = w_llll [ sum of distance weights ];

Parameters:
_Grid2DSquareCell - the Grid2DSquareCellDouble to be processed
distance - the distance within which metrics will be calculated
weightIntersect - kernel parameter ( weight at the centre )
weightFactor - kernel parameter ( distance decay )
_Grid2DSquareCellDoubleFactory - The Grid2DSquareCellDoubleFactory for creating grids
Throws:
java.io.IOException

getMetrics1Names

protected java.lang.String[] getMetrics1Names()
TODO


getMetrics1

public AbstractGrid2DSquareCell[] getMetrics1(AbstractGrid2DSquareCell[] metrics1,
                                              AbstractGrid2DSquareCell _Grid2DSquareCell,
                                              java.math.BigDecimal[] dimensions,
                                              double distance,
                                              double weightIntersect,
                                              double weightFactor,
                                              boolean handleOutOfMemoryError)
Returns an Grid2DSquareCellDouble[] metrics1 where: \n metrics1[0] = no data count; \n metrics1[1] = flatness; \n metrics1[2] = roughness; \n metrics1[3] = slopyness; \n metrics1[4] = levelness; \n metrics1[5] = totalDownness; \n metrics1[6] = averageDownness; \n metrics1[7] = totalUpness; \n metrics1[8] = averageUpness; \n metrics1[9] = maxd_hhhh [ sum of distance weighted maximum height differences ]; \n metrics1[10] = mind_hhhh [ sum of distance weighted minimum height differences ]; \n metrics1[11] = sumd_hhhh [ sum of distance weighted height differences ]; \n metrics1[12] = aved_hhhh [ sum of distance weighted average height difference ]; \n metrics1[13] = count_hhhh [ count ]; \n metrics1[14] = w_hhhh [ sum of distance weights ]; \n metrics1[15] = mind_hxhx_ai_hhhl [ sum of distance weighted ( minimum difference of cells adjacent to lower cell ) ]; \n metrics1[16] = maxd_hxhx_ai_hhhl [ sum of distance weighted ( maximum difference of cells adjacent to lower cell ) ]; \n metrics1[17] = sumd_hxhx_ai_hhhl [ sum of distance weighted ( sum of differences of cells adjacent to lower cell ) ]; \n metrics1[18] = d_xhxx_ai_hhhl [ sum of distance weighted ( difference of cell opposite lower cell ) ]; \n metrics1[19] = d_xxxl_ai_hhhl [ sum of distance weighted ( difference of lower cell ) ]; \n metrics1[20] = sumd_xhxl_ai_hhhl [ sum of distance weighted ( sum of differences of lower cell and cell opposite ) ]; \n metrics1[21] = mind_abs_xhxl_ai_hhhl [ sum of distance weighted ( minimum difference magnitude of lower cell and cell opposite ) ]; \n metrics1[22] = maxd_abs_xhxl_ai_hhhl [ sum of distance weighted ( maximum difference magnitude of lower cell and cell opposite ) ]; \n metrics1[23] = sumd_abs_xhxl_ai_hhhl [ sum of distance weighted ( sum of difference magnitudes of lower cell and cell opposite ) ]; \n metrics1[24] = count_hhhl [ count ]; \n metrics1[25] = w_hhhl [ sum of distance weights ]; \n metrics1[26] = mind_hxhx_ai_hlhl [ sum of distance weighted ( minimum difference of higher cells ) ]; \n metrics1[27] = maxd_hxhx_ai_hlhl [ sum of distance weighted ( maximum difference of higher cells ) ]; \n metrics1[28] = sumd_hxhx_ai_hlhl [ sum of distance weighted ( sum differences of higher cells ) ]; \n metrics1[29] = mind_xlxl_ai_hlhl [ sum of distance weighted ( minimum difference of lower cells ) ]; \n metrics1[30] = maxd_xlxl_ai_hlhl [ sum of distance weighted ( maximum difference of lower cells ) ]; \n metrics1[31] = sumd_xlxl_ai_hlhl [ sum of distance weighted ( sum of differences of lower cells ) ]; \n metrics1[32] = mind_abs_hlhl [ sum of distance weighted ( minimum difference magnitude of cells ) ]; \n metrics1[33] = maxd_abs_hlhl [ sum of distance weighted ( maximum difference magnitude of cells ) ]; \n metrics1[34] = sumd_abs_hlhl [ sum of distance weighted ( sum of difference magnitudes of cells ) ]; \n metrics1[35] = count_hlhl [ count ]; \n metrics1[36] = w_hlhl [ sum of distance weights ]; \n metrics1[37] = mind_hhxx_ai_hhll [ sum of distance weighted ( minimum difference of higher cells ) ]; \n metrics1[38] = maxd_hhxx_ai_hhll [ sum of distance weighted ( maximum difference of higher cells ) ]; \n metrics1[39] = sumd_hhxx_ai_hhll [ sum of distance weighted ( sum of differences of higher cells ) ]; \n metrics1[40] = mind_xxll_ai_hhll [ sum of distance weighted ( minimum difference of lower cells ) ]; \n metrics1[41] = maxd_xxll_ai_hhll [ sum of distance weighted ( maximum difference of lower cells ) ]; \n metrics1[42] = sumd_xxll_ai_hhll [ sum of distance weighted ( sum of differences of lower cells ) ]; \n metrics1[43] = mind_abs_hhll [ sum of distance weighted ( minimum difference magnitude of cells ) ]; \n metrics1[44] = maxd_abs_hhll [ sum of distance weighted ( maximum difference magnitude of cells ) ]; \n metrics1[45] = sumd_abs_hhll [ sum of distance weighted ( sum of difference magnitudes of cells ) ]; \n metrics1[46] = count_hhll [ count ]; \n metrics1[47] = w_hhll [ sum of distance weights ]; \n metrics1[48] = mind_lxlx_ai_lllh [ sum of distance weighted ( minimum difference of cells adjacent to higher cell ) ]; \n metrics1[49] = maxd_lxlx_ai_lllh [ sum of distance weighted ( maximum difference of cells adjacent to higher cell ) ]; \n metrics1[50] = sumd_lxlx_ai_lllh [ sum of distance weighted ( sum of differences of cells adjacent to higher cell ) ]; \n metrics1[51] = d_xlxx_ai_lllh [ sum of distance weighted ( difference of cell opposite higher cell ) ]; \n metrics1[52] = d_xxxh_ai_lllh [ sum of distance weighted ( difference of higher cell ) ]; \n metrics1[53] = sumd_xlxh_ai_lllh [ sum of distance weighted ( sum of differences of higher cell and cell opposite ) ]; \n metrics1[54] = mind_abs_xlxh_ai_lllh [ sum of distance weighted ( minimum difference magnitude of higher cell and cell opposite ) ]; \n metrics1[55] = maxd_abs_xlxh_ai_lllh [ sum of distance weighted ( maximum difference magnitude of higher cell and cell opposite ) ]; \n metrics1[56] = sumd_abs_xlxh_ai_lllh [ sum of distance weighted ( sum of difference magnitudes of higher cell and cell opposite ) ]; \n metrics1[57] = count_lllh [ count ]; \n metrics1[58] = w_lllh [ sum of distance weights ]; \n metrics1[59] = maxd_llll [ sum of distance weighted maximum height differences ]; \n metrics1[60] = mind_llll [ sum of distance weighted minimum height differences ]; \n metrics1[61] = sumd_llll [ sum of distance weighted height differences ]; \n metrics1[62] = aved_llll [ sum of distance weighted average height difference ]; \n metrics1[63] = count_llll [ count ]; \n metrics1[64] = w_llll [ sum of distance weights ]; \n

Parameters:
metrics1 - an Grid2DSquareCellDouble[] for storing result \n
_Grid2DSquareCell - the Grid2DSquareCellDouble to be processed \n
distance - the distance within which metrics will be calculated \n
weightIntersect - kernel parameter ( weight at the centre ) \n
weightFactor - kernel parameter ( distance decay ) \n Going directly to this method is useful if the initialisation of the metrics1 is slow and has already been done.

getMetrics2

public Grid2DSquareCellDouble[] getMetrics2(Grid2DSquareCellDouble grid,
                                            double distance,
                                            double weightIntersect,
                                            double weightFactor,
                                            int samplingDensity,
                                            Grid2DSquareCellDoubleFactory gridFactory,
                                            boolean handleOutOfMemoryError)
Returns an Grid2DSquareCellDouble[] metrics2 where: TODO: metrics2 is a mess. Need to decide what to do with regard to contour tracing and profile trace for axes and comparisons. metrics2[0] = slope; metrics2[1] = aspect; metrics2[2] = no data count; metrics2[3] = contourConcavity; metrics2[4] = contourConvexity; metrics2[5] = profileConcavity; metrics2[6] = profileConvexity;


getMaxFlowDirection

public Grid2DSquareCellDouble getMaxFlowDirection(Grid2DSquareCellDouble grid,
                                                  Grid2DSquareCellDoubleFactory gridFactory,
                                                  boolean handleOutOfMemoryError)
Returns an Grid2DSquareCellDouble result containing values which indicate the direction of the maximum down slope for the immediate 8 cell neighbourhood. 1 2 3 4 0 5 6 7 8 If there is no downhill slope then the flow direction is 0.

Parameters:
grid - the Grid2DSquareCellDouble to be processed
gridFactory - the Grid2DSquareCellDoubleFactory used to create result

getUpSlopeAreaMetrics

public Grid2DSquareCellDouble getUpSlopeAreaMetrics(Grid2DSquareCellDouble grid,
                                                    double distance,
                                                    double weightFactor,
                                                    double weightIntersect,
                                                    Grid2DSquareCellDoubleFactory gridFactory,
                                                    boolean handleOutOfMemoryError)
Returns an Grid2DSquareCellDouble[] each element of which corresponds to a metrics of up slope cells of grid - a DEM The steeper the slope the higher the runoff?


getInitialPeaksHashSetAndSetTheirValue

public java.util.HashSet getInitialPeaksHashSetAndSetTheirValue(Grid2DSquareCellDouble grid,
                                                                Grid2DSquareCellDouble upSlopeAreaMetrics,
                                                                boolean handleOutOfMemoryError)
Returns a HashSet containing _CellIDs which identifies cells for which neighbouring cells in the immediate 8 cell neighbourhood that are either the same value, lower or noDataValues

Parameters:
grid - - the Grid2DSquareCellDouble to be processed