jwo.landserf.process
Class VoidRemovalThread

java.lang.Object
  extended byjava.lang.Thread
      extended byjwo.landserf.process.LSThread
          extended byjwo.landserf.process.VoidRemovalThread
All Implemented Interfaces:
JWInterruptionListener, Runnable

public class VoidRemovalThread
extends LSThread

Removes voids from a raster by taking average of non-void neighbours. Removes voids iteratively prioritising void cells with the smallest number of non-void neighbours.

Version:
2.2, 26th February, 2005.
Author:
Jo Wood

Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
VoidRemovalThread(GISFrame gisFrame)
          Processes the primary raster by looking for void cells (represented by RasterMap.NO_VALUE).
 
Method Summary
 void doProcessing()
          Processes DEM looking for and removing voids.
 int getNumNeighbours(RasterMap raster, int row, int col)
          Counts the number of non-void neighbours surrounding a given cell.
 
Methods inherited from class jwo.landserf.process.LSThread
checkStoppedThread, interruptionRequested, resetTimer, run, setErrorMessage, setMessage
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VoidRemovalThread

public VoidRemovalThread(GISFrame gisFrame)
Processes the primary raster by looking for void cells (represented by RasterMap.NO_VALUE).

Parameters:
gisFrame - GISFrame holding raster to process.
Method Detail

doProcessing

public void doProcessing()
Processes DEM looking for and removing voids. If raster is entirely composed of voids, all values will be reclassified as 0. This does not produce a new raster but alters the primary raster stored in the GIS frame supplied to the constructor.

Note that this method will be called automatically if this is run as a threaded process (e.g. myVoidRemovalThread.start()). Alternatively it can be called directly as a non-threaded process.

Specified by:
doProcessing in class LSThread
See Also:
GISFrame

getNumNeighbours

public int getNumNeighbours(RasterMap raster,
                            int row,
                            int col)
Counts the number of non-void neighbours surrounding a given cell.

Parameters:
raster - Raster map to examine.
row - Row coordinate of cell to examine.
col - Column coordinate of cell to examine.
Returns:
Number of non-void neighbours (between 0 and 8).


Copyright Jo Wood, 1996-2005, last modified, 11th March, 2005