jwo.landserf.process
Class ContourThread

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

public class ContourThread
extends LSThread
implements Scriptable

Class for fitting contour lines through a gridded surface.

Version:
2.3, 17th July, 2006.
Author:
Jo Wood adapted from CONREC (Bourke, 1987).

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
ContourThread(GISFrame gisFrame)
          Creates an object ready for contouring but does not perform the transformation.
ContourThread(GISFrame gisFrame, float lowest, float interval, int gridWidth)
          Creates a contoured vector map of the given surface with the given minimum contour and vertical interval.
 
Method Summary
 boolean doCommand(LSCommand command)
          Creates a vector map containing the contoured surface.
 void doProcessing()
          Creates a new contour vector map by threading contour segments through the primary raster stored in the GISFrame provided to the constructor.
 LSCommand getCommand()
          Reports the syntax required to allow contours to be created via a scripting command.
 VectorMap getContourMap()
          Retrieves the newly created contour map.
 GISFrame getGISFrame()
          Retrieves the GISFrame that can be used for storing multiple spatial objects.
 Object getReturnedObject()
          Returns a vector map holding the contoured surface.
 
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

ContourThread

public ContourThread(GISFrame gisFrame)
Creates an object ready for contouring but does not perform the transformation. This is primarily used for contouring rasters via the scripting interface.

Parameters:
gisFrame - Frame in which to report results.

ContourThread

public ContourThread(GISFrame gisFrame,
                     float lowest,
                     float interval,
                     int gridWidth)
Creates a contoured vector map of the given surface with the given minimum contour and vertical interval.

Parameters:
gisFrame - GISFrame holding raster to contour.
lowest - Lowest contour level.
interval - Vertical interval between contours.
gridWidth - Sampling frequency of raster.
Method Detail

getCommand

public LSCommand getCommand()
Reports the syntax required to allow contours to be created via a scripting command.

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

doCommand

public boolean doCommand(LSCommand command)
Creates a vector map containing the contoured surface.

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

getReturnedObject

public Object getReturnedObject()
Returns a vector map holding the contoured surface. If command has yet to be issued this will return null.

Specified by:
getReturnedObject in interface Scriptable
Returns:
New spatial object or null if problems contouring surface 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 new contour vector map by threading contour segments through the primary raster stored in the GISFrame provided to the constructor. The newly created vector map containing the contours is added to the GISFrame provided to the constructor as a primary vector map. This can be retrieved by calling gisFrame.getVectorMap1(); or directly from this class via getContourMap().

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

Specified by:
doProcessing in class LSThread
See Also:
GISFrame

getContourMap

public VectorMap getContourMap()
Retrieves the newly created contour map.

Returns:
New contour map, or null if problems contouring or process yet to take place.


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