jwo.landserf.process
Class FlowThread
java.lang.Object
java.lang.Thread
jwo.landserf.process.LSThread
jwo.landserf.process.FlowThread
- All Implemented Interfaces:
- Runnable, JWInterruptionListener
public class FlowThread
- extends LSThread
Creates a raster containing flow magnitudes. This can be used to detect drainage
networks by selecting values above a given threshold.
- Version:
- 2.3, 17th December, 2008.
- Author:
- Jo Wood
Constructor Summary |
FlowThread(GISFrame gisFrame,
int flowThreshold,
float sampleRate)
Processes the primary raster to create the flow accumulation surface and possible
flow vectors. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
FlowThread
public FlowThread(GISFrame gisFrame,
int flowThreshold,
float sampleRate)
- Processes the primary raster to create the flow accumulation surface and possible
flow vectors. Density of flow vectors can be controlled with
sampleRate
which randomly samples locations to be included as flow vectors and flowThreshold
which sets the minimum flow accumulation required before a flow vector is drawn. Note that
flowThreshold
and sampleRate
have no effect on the flow accumulation
raster produced by this process. If sampleRate
<= 0, no flow vectors are created.
- Parameters:
flowThreshold
- Minimum number of cells of flow accumulation to define a flow vector.sampleRate
- Proportion of cells to be sampled when calculating flow vectors (between 0 and 1).gisFrame
- GISFrame holding raster to process.
doProcessing
public void doProcessing()
- Performs the flow accumulation calculation. This method uses the 'rolling ball' method suggested
by Lea (1992) and uses non-raster flow positioning. This ensures that raster artifacts are minimised
in the flow accumulation values. Flow does not accumulate across flat areas.
The flow accumulation raster can be retrieved directly via this class's
getFlowAccumulation()
method, or by calling gisFrame.getRaster2();
.
Note that this method will be called automatically if this is run as a threaded
process (e.g. myFlowThread.start()). Alternatively it can be called directly
as a non-threaded process.
- Specified by:
doProcessing
in class LSThread
- See Also:
GISFrame
getFlowAccumulation
public RasterMap getFlowAccumulation()
- Retrieves the newly created flow accumulation surface.
- Returns:
- New flow accumulation surface, or null if process yet to take place.
Copyright Jo Wood, 1996-2009, last modified, 17th April, 2009