jwo.landserf.process
Class CombineThread
java.lang.Object
java.lang.Thread
jwo.landserf.process.LSThread
jwo.landserf.process.CombineThread
- All Implemented Interfaces:
- JWInterruptionListener, Runnable
- public class CombineThread
- extends LSThread
Combines two spatial objects to create a new spatial object.
- Version:
- 2.2, 6th February, 2005.
- Author:
- Jo Wood
Constructor Summary |
CombineThread(GISFrame gisFrame,
int spatialType,
int combineType,
int combineRule,
boolean replaceNull)
Combines the primary and secondary objects stored in the gisFrame. |
Method Summary |
void |
doProcessing()
Combines the primary and secondary spatial objects according to the supplied rules.
|
SpatialObject |
getCombinedMap()
Retrieves the combined spatial object (either a RasterMap or VectorMap
depending on what spatial types were provided to the constructor). |
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 |
CombineThread
public CombineThread(GISFrame gisFrame,
int spatialType,
int combineType,
int combineRule,
boolean replaceNull)
- Combines the primary and secondary objects stored in the gisFrame.
- Parameters:
gisFrame
- Frame holding the spatial objects to combine.spatialType
- Type of spatial objects to combine.combineType
- Type of combination (INTERSECTION or UNION).combineRule
- Indicates the type of combination rule to apply. Depends
on the spatial object type. For rasters, rule dertermines priority
attribute for intersection regions (PRIMARY, SECONDARY or AVERAGE.
For vector maps, rule determines if intersection should be of bounding
rectangles or polygons in vector map.replaceNull
- Indicates whether null values will be replaced where
possible (only applies to raster maps).
doProcessing
public void doProcessing()
- Combines the primary and secondary spatial objects according to the supplied rules.
The resulting spatial object is added to the
GISFrame
provided to the
constructor, but will not be selected as either a primary or secondary raster/vector map.
To retrieve it either call getCombinedMap()
from this class or call
gisFrame.getRasterMaps();
/ gisFrame.getVectorMaps();
and
retrieve the last object added to the collection.
Note that this method will be called automatically if this is run as a threaded
process (e.g. myCombineThread.start()). Alternatively it can be called directly
as a non-threaded process.
- Specified by:
doProcessing
in class LSThread
- See Also:
GISFrame
getCombinedMap
public SpatialObject getCombinedMap()
- Retrieves the combined spatial object (either a RasterMap or VectorMap
depending on what spatial types were provided to the constructor).
- Returns:
- New combined spatial object, or null if problems or combination
yet to take place.
Copyright Jo Wood, 1996-2005, last modified, 11th March, 2005