jwo.landserf.process
Class PeakClassificationThread

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

public class PeakClassificationThread
extends LSThread
implements Scriptable

Creates a new raster identifying peaks from a given DEM. This requires parameters such as minimum height and minimum drop to be supplied allowing Munros, Corbetts, Hewitts, Marilyns etc. to be identified.

Version:
2.3, 29th 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
PeakClassificationThread(GISFrame gisFrame)
          Creates an object ready for peak classification but does not perform the classification itself.
PeakClassificationThread(GISFrame gisFrame, float minHeight, float minDrop, boolean doPeakedness, boolean doSummits, boolean doHierarchy)
          Classifies the DEM according to the peak classification parameters.
 
Method Summary
 boolean doCommand(LSCommand command)
          Performs the peak classification based on the given command parameters.
 void doProcessing()
          Processes DEM stored as the primary raster in the GISFrame provided to the constructor and creates a raster map of peaks.
 LSCommand getCommand()
          Reports the syntax required to allow a DEM to be classified into peaks and summits via a scripting command.
 RasterMap getFuzzyPeakMap()
          Retrieves the newly created raster map containing fuzzy peak memberships.
 GISFrame getGISFrame()
          Retrieves the GISFrame that can be used for storing multiple spatial objects.
 RasterMap getPeakHierarchyMap()
          Retrieves the newly created raster map containing nested peak catchments.
 RasterMap getPeakMap()
          Retrieves the newly created raster map containing peaks and summits.
 Object getReturnedObject()
          Returns a raster map representing the peak classification.
 VectorMap getSummitMap()
          Retrieves the newly created vector map containing summits and their drops.
 
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

PeakClassificationThread

public PeakClassificationThread(GISFrame gisFrame)
Creates an object ready for peak classification but does not perform the classification itself. This is primarily used for use via the scripting interface.

Parameters:
gisFrame - Frame in which to report results.

PeakClassificationThread

public PeakClassificationThread(GISFrame gisFrame,
                                float minHeight,
                                float minDrop,
                                boolean doPeakedness,
                                boolean doSummits,
                                boolean doHierarchy)
Classifies the DEM according to the peak classification parameters.

Parameters:
gisFrame - GISFrame holding DEM to process.
minHeight - Minimum height of peak.
minDrop - Minimum drop surrounding peak.
doPeakedness - Peakedness calculation performed if true.
doSummits - Calculates vector summit locations if true.
doHierarchy - Calculates peak hierarchy if true.
Method Detail

getCommand

public LSCommand getCommand()
Reports the syntax required to allow a DEM to be classified into peaks and summits via a scripting command.

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

doCommand

public boolean doCommand(LSCommand command)
Performs the peak classification based on the given command parameters.

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

getReturnedObject

public Object getReturnedObject()
Returns a raster map representing the peak classification. 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 performing the classification 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()
Processes DEM stored as the primary raster in the GISFrame provided to the constructor and creates a raster map of peaks. Depending on options given to the constructor, can also generate a raster map of nested peak catchments, a raster map representing fuzzy peak extents and a vector map containing summits and drops. The newly created raster map containing the peaks is added to the GISFrame provided to the constructor as a secondary raster. This can be retrieved directly via this class's method getPeakMap(), or by calling gisFrame.getRaster2();. If summit vector map output has been chosen, the newly created vector map containing the summits and drops is added to the GISFrame provided to the constructor as a primary vector map. This can be retrieved directly via this class's method getSummitMap(), or by calling gisFrame.getVector1();. If the fuzzy peak or peak hierarchy options are selected, these raster maps can be retrieved directly via this class's getFuzzyPeakMap() and getPeakHierarchyMap() methods. Alternatively, they can be retrieved via the GISFrame's getRasterMaps() method (the last one/two map(s) added).

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

Specified by:
doProcessing in class LSThread
See Also:
GISFrame

getPeakMap

public RasterMap getPeakMap()
Retrieves the newly created raster map containing peaks and summits.

Returns:
New peak map, or null if problem or process yet to take place.

getFuzzyPeakMap

public RasterMap getFuzzyPeakMap()
Retrieves the newly created raster map containing fuzzy peak memberships.

Returns:
New fuzzy peak map, or null if problem, option not selected or process yet to take place.

getPeakHierarchyMap

public RasterMap getPeakHierarchyMap()
Retrieves the newly created raster map containing nested peak catchments.

Returns:
New nested peak catchment map, or null problem, option not selected or process yet to take place.

getSummitMap

public VectorMap getSummitMap()
Retrieves the newly created vector map containing summits and their drops.

Returns:
New summit map, or null if problem, summit map not selected or process yet to take place.


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