|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectes.unex.sextante.core.GeoAlgorithm
public abstract class GeoAlgorithm
A class defining a geo-algorithm
Constructor Summary | |
---|---|
GeoAlgorithm()
|
Method Summary | |
---|---|
boolean |
adjustRasterOutputExtent()
This method sets the raster output extent according to input layers, in case it hasn't been set. |
abstract void |
defineCharacteristics()
This method should be overridden and used to specify the parameters needed by the GeoAlgorithm, using the corresponding methods of the ParametersSet object. |
boolean |
execute(ITaskMonitor task,
OutputFactory outputFactory)
This method should be used to execute the algorithm once the parameters have been assigned. |
boolean |
generatesLayers()
Returns true if the algorithms generates new layers |
boolean |
generatesUserDefinedRasterOutput()
|
java.lang.String[] |
getAlgorithmAsCommandLineSentences()
Returns the command line expression that would create this instance of the algorithm |
java.lang.String |
getCommandLineHelp()
Returns a string containing the command line usage of the algorithm |
java.lang.String |
getCommandLineName()
|
GridExtent |
getGridExtent()
|
java.lang.String |
getGroup()
|
java.lang.String |
getMessages()
Returns a string with the messages produced by the algorithm |
java.lang.String |
getName()
|
GeoAlgorithm |
getNewInstance()
|
int |
getNumberOfLineVectorLayers()
|
int |
getNumberOfOutputLayers()
Returns the number of new layers generated by the algorithm |
int |
getNumberOfParameters()
|
int |
getNumberOfPointVectorLayers()
|
int |
getNumberOfPolygonLayers()
|
int |
getNumberOfRasterLayers()
|
int |
getNumberOfTables()
|
int |
getNumberOfVectorLayers()
|
OutputObjectsSet |
getOutputObjects()
|
ParametersSet |
getParameters()
|
java.util.HashMap |
getProcessMetadata()
Returns a map with metadata entries. |
boolean |
hasCorrectParameterValues()
Returns true if the algorithm parameters have correct values. |
boolean |
isDeterminatedProcess()
|
boolean |
isSuitableForModelling()
|
boolean |
meetsDataRequirements(java.lang.Object[] objs)
Returns true if the algorithm could be executed with the given data objects. |
boolean |
meetsRasterRequirements(java.lang.Object[] objs)
Returns false if there are not enough raster data in the given array to run the algorithm |
boolean |
meetsTableRequirements(java.lang.Object[] objs)
Returns false if there are not enough table objects in the given array to run the algorithm |
boolean |
meetsVectorRequirements(java.lang.Object[] objs)
Returns false if there are not enough vector data in the given array to run the algorithm |
abstract boolean |
processAlgorithm()
This method should implement the algorithm itself, using the values of the parameters and processing them. |
boolean |
requiresIndividualRasterLayers()
Returns true if the algorithm requires raster layers as individual input (i.e. not as a multiple input) |
boolean |
requiresIndividualVectorLayers()
Returns true if the algorithm requires vector layers as individual input (i.e. not as a multiple input) |
boolean |
requiresLineVectorLayers()
Returns true if the algorithm requires line vector layers to run |
boolean |
requiresMultipleRasterBands()
Returns true if the algorithm requires raster bands as multiple input (i.e. the parameter set contains a multiple input parameter of type band) |
boolean |
requiresMultipleRasterLayers()
Returns true if the algorithm requires raster layers as multiple input |
boolean |
requiresMultipleTables()
Returns true if the algorithm requires tables layers as multiple input |
boolean |
requiresMultipleVectorLayers()
Returns true if the algorithm requires vector layers as multiple input |
boolean |
requiresNonDataObjects()
|
boolean |
requiresPoints()
Returns true if the algorithm requires point coordinates to run |
boolean |
requiresPointVectorLayers()
Returns true if the algorithm requires point vector layers to run |
boolean |
requiresPolygonVectorLayers()
Returns true if the algorithm requires polygon vector layers to run |
boolean |
requiresRasterLayers()
Returns true if the algorithm requires raster layers to run |
boolean |
requiresTableFields()
Returns true if the algorithm requires table field layers to run |
boolean |
requiresTables()
Returns true if the algorithm requires raster layers to run |
boolean |
requiresVectorLayers()
Returns true if the algorithm requires vector layers to run |
void |
setGeneratesUserDefinedRasterOutput(boolean bGeneratesRasterOutput)
Use this method to indicate that the algorithm generates new raster layers and the user can select their grid extent. |
void |
setGridExtent(GridExtent gridExtent)
Sets a new grid extent that will be used to create new raster layer if the algorithm generates that kind of output |
void |
setGroup(java.lang.String sGroup)
Sets the name of the group this algorithm belongs to. |
void |
setIsDeterminatedProcess(boolean bDeterminated)
Use this method to indicate that the algorithm is determinated (i.e. the number of steps to complete it is known) |
void |
setName(java.lang.String sName)
Sets the algorithm name. |
void |
setOutputObjects(OutputObjectsSet ooSet)
sets a new set of output objects |
void |
setParameters(ParametersSet parameters)
sets a new set of parameters for the algorithm |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GeoAlgorithm()
Method Detail |
---|
public abstract void defineCharacteristics()
addOutputRasterLayer(java.lang.String, java.lang.String, int, java.lang.String, es.unex.sextante.dataObjects.IRasterLayer)
, addOutputVectorLayer(java.lang.String, java.lang.String, int, java.lang.String, es.unex.sextante.dataObjects.IVectorLayer)
, etc.)
public boolean execute(ITaskMonitor task, OutputFactory outputFactory) throws GeoAlgorithmExecutionException
task
- a ITaskMonitor to track the progress of the execution.
If is null, a @see SilentTaskMonitor
will be used.outputFactory
- The output factory to use to generate
new data objects
GeoAlgorithmExecutionException
public java.util.HashMap getProcessMetadata()
public abstract boolean processAlgorithm() throws GeoAlgorithmExecutionException
GeoAlgorithmExecutionException
- if there were problems
during algorithm executionpublic boolean adjustRasterOutputExtent()
public java.lang.String getName()
public void setName(java.lang.String sName)
Sextante.getText(String)
to support internationalization
sName
- the name of the algorithmpublic java.lang.String getGroup()
public void setGroup(java.lang.String sGroup)
Sextante.getText(String)
to support internationalization
sGroup
- the name of the grouppublic ParametersSet getParameters()
public void setParameters(ParametersSet parameters)
parameters
- the new set of parameterspublic GridExtent getGridExtent()
public void setGridExtent(GridExtent gridExtent)
gridExtent
- the new grid extentpublic java.lang.String getMessages()
public boolean requiresNonDataObjects()
public int getNumberOfParameters()
public int getNumberOfRasterLayers()
public int getNumberOfVectorLayers()
public int getNumberOfPointVectorLayers()
public int getNumberOfLineVectorLayers()
public int getNumberOfPolygonLayers()
public int getNumberOfTables()
public boolean generatesUserDefinedRasterOutput()
public void setGeneratesUserDefinedRasterOutput(boolean bGeneratesRasterOutput)
bGeneratesRasterOutput
- true if the algorithm generates
new raster layerspublic void setIsDeterminatedProcess(boolean bDeterminated)
bDeterminated
- true if it is a determinated algorithmpublic boolean isDeterminatedProcess()
public OutputObjectsSet getOutputObjects()
public void setOutputObjects(OutputObjectsSet ooSet)
ooSet
- the new set of output objectspublic java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getCommandLineName()
public GeoAlgorithm getNewInstance() throws java.lang.InstantiationException, java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.IllegalAccessException
public boolean isSuitableForModelling()
public boolean generatesLayers()
public int getNumberOfOutputLayers()
public java.lang.String getCommandLineHelp()
public java.lang.String[] getAlgorithmAsCommandLineSentences()
public boolean requiresVectorLayers()
ParametersSet.requiresVectorLayers()
public boolean requiresIndividualVectorLayers()
public boolean requiresPolygonVectorLayers()
ParametersSet.requiresPolygonVectorLayers()
public boolean requiresLineVectorLayers()
ParametersSet.requiresLineVectorLayers()
public boolean requiresPointVectorLayers()
ParametersSet.requiresVectorLayers()
public boolean requiresRasterLayers()
ParametersSet.requiresVectorLayers()
public boolean requiresIndividualRasterLayers()
public boolean requiresMultipleRasterLayers()
public boolean requiresMultipleVectorLayers()
public boolean requiresMultipleTables()
public boolean requiresMultipleRasterBands()
public boolean requiresTables()
ParametersSet.requiresVectorLayers()
public boolean requiresTableFields()
ParametersSet.requiresTableFields()
public boolean requiresPoints()
ParametersSet.requiresPoints()
public boolean meetsRasterRequirements(java.lang.Object[] objs)
objs
- an array of available data objects
public boolean meetsVectorRequirements(java.lang.Object[] objs)
objs
- an array of available data objects
public boolean meetsTableRequirements(java.lang.Object[] objs)
objs
- an array of available data objects
public boolean meetsDataRequirements(java.lang.Object[] objs)
objs
- an array of available data objects
public boolean hasCorrectParameterValues()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |