jwo.landserf.process
Class SurfParamThread

java.lang.Object
  extended by java.lang.Thread
      extended by jwo.landserf.process.LSThread
          extended by jwo.landserf.process.SurfParamThread
All Implemented Interfaces:
Runnable, Scriptable, JWInterruptionListener

public class SurfParamThread
extends LSThread
implements Scriptable

Calculates a given surface parameter such as slope, aspect, curvature or feature type.

Version:
2.3, 12th September, 2008.
Author:
Jo Wood

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
SurfParamThread(GISFrame gisFrame)
          Prepares the class for calculation of surface parameters.
SurfParamThread(GISFrame gisFrame, SurfParam surfParam)
          Prepares the class for calculation of a given surface parameter.
 
Method Summary
 boolean doCommand(LSCommand command)
          Calculates the surface parameter of the object provided by the given scripting parameters.
 void doProcessing()
          Creates a raster containing the surface parameter values.
 LSCommand getCommand()
          Reports the syntax required to allow surface parameters to be calculated via a scripting command.
 GISFrame getGISFrame()
          Retrieves the GISFrame that can be used for storing multiple spatial objects.
 RasterMap getParamMap()
          Retrieves the newly created raster map containing the selected surface parameter values.
 Object getReturnedObject()
          Returns a raster map containing the surface parameters or summary defined via scripting command.
 
Methods inherited from class jwo.landserf.process.LSThread
checkStoppedThread, interruptionRequested, resetTimer, run, setErrorMessage, setFinalMessage, setMessage
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SurfParamThread

public SurfParamThread(GISFrame gisFrame)
Prepares the class for calculation of surface parameters. This constructor is for use with scripting control as it does not define what type of parameter to calculate.

Parameters:
gisFrame - Frame holding spatial objects and in which to report results.

SurfParamThread

public SurfParamThread(GISFrame gisFrame,
                       SurfParam surfParam)
Prepares the class for calculation of a given surface parameter.

Parameters:
gisFrame - GIS frame containing raster to process.
surfParam - Surface parameter to calculate.
Method Detail

getCommand

public LSCommand getCommand()
Reports the syntax required to allow surface parameters to be calculated via a scripting command.

Specified by:
getCommand in interface Scriptable
Returns:
Command syntax.

doCommand

public boolean doCommand(LSCommand command)
Calculates the surface parameter of the object provided by the given scripting parameters.

Specified by:
doCommand in interface Scriptable
Parameters:
command - Command containing parameter values.
Returns:
True if calculated successfully. If false, the details of the problem are reported to the gisFrame.

getReturnedObject

public Object getReturnedObject()
Returns a raster map containing the surface parameters or summary defined via scripting command. If command has yet to be issued this will return null.

Specified by:
getReturnedObject in interface Scriptable
Returns:
New raster or null if problems calculating the parameter or command has not yet been issued.

getGISFrame

public GISFrame getGISFrame()
Retrieves the GISFrame that can be used for storing multiple spatial objects.

Specified by:
getGISFrame in interface Scriptable
Returns:
GISFrame storing spatial objects.

doProcessing

public void doProcessing()
Creates a raster containing the surface parameter values. The newly created raster containing the parameter values (e.g. slope map) is added to the GISFrame provided to the constructor as a secondary raster. This can be retrieved directly via this class's method getParamMap(), or by calling gisFrame.getRaster2();.

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

Specified by:
doProcessing in class LSThread
See Also:
GISFrame

getParamMap

public RasterMap getParamMap()
Retrieves the newly created raster map containing the selected surface parameter values.

Returns:
New surface parameter map, or null if process yet to take place.


Copyright Jo Wood, 1996-2009, last modified, 17th April, 2009