public abstract class AbstractSextanteGeoProcess extends es.unex.sextante.core.GeoAlgorithm implements GeoProcess
GeoProcess
objects.Modifier and Type | Field and Description |
---|---|
protected String[] |
attrNames |
protected GeometryManager |
geomManager |
Constructor and Description |
---|
AbstractSextanteGeoProcess() |
Modifier and Type | Method and Description |
---|---|
protected FeatureStore |
buildOutPutStore(FeatureType featureType,
int shapeType,
String sextanteLayerName,
String sextanteLayerLabel)
Builds the output FeatureStore
|
protected FeatureStore |
buildOutPutStoreFromUnion(FeatureType featureType1,
FeatureType featureType2,
int shapeType,
String sextanteLayerName,
String sextanteLayerLabel)
Builds the output FeatureStore
|
protected FeatureStore |
buildOutPutStoreFromUnion(FeatureType featureType1,
FeatureType featureType2,
int shapeType,
String sextanteLayerName,
String sextanteLayerLabel,
String newField,
Class<?> newFieldType)
Builds the output FeatureStore
|
protected String |
checkAttrName(String name,
int size)
Changes the attribute name if this name is in the list.
|
boolean |
execute(es.unex.sextante.core.ITaskMonitor task,
es.unex.sextante.core.OutputFactory outputFactory,
HashMap<String,String> outputMap)
This method should be used to execute the algorithm once the parameters have been assigned.
|
boolean |
existsOutPutFile(String resultLabel,
int type)
Returns true if exists the output file and false i
|
String |
getCommandLineName() |
Class<? extends es.unex.sextante.gui.algorithm.GeoAlgorithmParametersPanel> |
getCustomParametersPanelClass() |
GeoProcessManager |
getGeoProcessManager()
Returns the
GeoProcessManager . |
String |
getGeoProcessName()
Returns the name of the geoprocess.
|
protected es.unex.sextante.dataObjects.IRasterLayer |
getNewRORasterLayer(String sName,
String sDescription,
int iDataType,
int iBands)
This method creates a new raster layer and adds it to the set of output objects of the algorithm.
|
String |
getOutPutFile(String resultLabel) |
FeatureQuery |
getQueryFromAnalysisExtent(es.unex.sextante.core.AnalysisExtent e,
FeatureStore store)
Gets a feature query using the analysis bounding box
|
protected int |
getShapeType(FeatureStore storeLayer1)
Gets the shape type of the selected feature store
|
protected SimpleTaskStatusDelegated |
getStatus() |
es.unex.sextante.core.ITaskMonitor |
getTaskMonitor() |
protected String |
getTranslation(String label)
Returns the translation for a label depending on the current locale.
|
protected boolean |
isLine(FeatureStore store)
Returns true if it is a line layer
|
protected boolean |
isPoint(FeatureStore store)
Returns true if it is a point layer
|
protected boolean |
isPolygon(FeatureStore store)
Returns true if it is a polygon layer
|
protected boolean |
isUndefined(FeatureStore store)
Returns true if it is a line layer
|
boolean |
setProgress(int iStep,
int iTotalNumberOfSteps)
Sets the current step in the progress bar, based on the ratio between the current task step and the total number of steps
needed to complete the task
|
protected void |
setProgressText(String sText)
Sets the current progress text.
|
void |
setTaskMonitor(es.unex.sextante.core.ITaskMonitor task) |
addOutput3DRasterLayer, addOutput3DRasterLayer, addOutputChart, addOutputChart, addOutputImage, addOutputNumericalValue, addOutputNumericalValue, addOutputObject, addOutputObject, addOutputRasterLayer, addOutputRasterLayer, addOutputRasterLayer, addOutputTable, addOutputTable, addOutputText, addOutputText, addOutputVectorLayer, addOutputVectorLayer, addOutputVectorLayer, addOutputVectorLayer, addOutputVectorLayer, adjustOutputExtent, canDefineOutputExtentFromInput, checkAttrName, defineCharacteristics, execute, generatesLayers, generatesLayersOrTables, getAlgorithmAsCommandLineSentences, getAnalysisExtent, getColorAlpha, getColorB, getColorG, getColorR, getCommandLineHelp, getCommandLineParametersHelp, getDescription, getGroup, getHelpFile, getName, getNew3DRasterLayer, getNew3DRasterLayer, getNewInstance, getNewRasterLayer, getNewRasterLayer, getNewRasterLayer, getNewRasterLayer, getNewTable, getNewVectorLayer, getNewVectorLayer, getNewVectorLayer, getNewVectorLayer, getNumberOfBandsParameters, getNumberOfLineVectorLayers, getNumberOfNoDataParameters, getNumberOfOutputObjects, getNumberOfParameters, getNumberOfPointVectorLayers, getNumberOfPolygonLayers, getNumberOfRasterLayers, getNumberOfTableFieldsParameters, getNumberOfTables, getNumberOfVectorLayers, getOutputChannel, getOutputCRS, getOutputFilename, getOutputObjects, getParameters, getProcessMetadata, getTempRasterLayer, getTempRasterLayer, getTempVectorLayer, getUserCanDefineAnalysisExtent, hasCorrectParameterValues, initializeDefaultValues, is3D, isActive, isAutoExtent, isDeterminatedProcess, isSuitableForModelling, meets3DRasterRequirements, meetsDataRequirements, meetsRasterRequirements, meetsTableRequirements, meetsVectorRequirements, preprocessForModeller, processAlgorithm, requires3DRasterLayers, requiresIndividualRasterLayers, requiresIndividualVectorLayers, requiresLineVectorLayers, requiresMultipleRasterBands, requiresMultipleRasterLayers, requiresMultipleTables, requiresMultipleVectorLayers, requiresNonDataObjects, requiresPoints, requiresPointVectorLayers, requiresPolygonVectorLayers, requiresRasterLayers, requiresTableFields, requiresTables, requiresVectorLayers, setAnalysisExtent, setColorAlpha, setColorB, setColorG, setColorR, setDescription, setGroup, setIsDeterminatedProcess, setName, setOutputObjects, setParameters, setUserCanDefineAnalysisExtent, toString
protected String[] attrNames
protected GeometryManager geomManager
public boolean execute(es.unex.sextante.core.ITaskMonitor task, es.unex.sextante.core.OutputFactory outputFactory, HashMap<String,String> outputMap) throws es.unex.sextante.exceptions.GeoAlgorithmExecutionException
es.unex.sextante.core.GeoAlgorithm
execute
in class es.unex.sextante.core.GeoAlgorithm
task
- a ITaskMonitor to track the progress of the execution. If is null, aoutputFactory
- The output factory to use to generate new data objectsoutputMap
- Maps IDataObject
algorithm output names to the desired output name. At IDataObject output creation,
OutputFactory
implementations will receive the values in this map as names.es.unex.sextante.exceptions.GeoAlgorithmExecutionException
SilentTaskMonitor} will be used.
protected es.unex.sextante.dataObjects.IRasterLayer getNewRORasterLayer(String sName, String sDescription, int iDataType, int iBands) throws es.unex.sextante.exceptions.UnsupportedOutputChannelException
GeoAlgorithm.getAnalysisExtent()
sName
- The name of the layer. Has to be the same that you used to define this output in thesDescription
- the long description of the output. This is the one usually used to describe the layer when added to a GIS
GUIiDataType
- The data type. SeeiBands
- the number of bands of the new layeres.unex.sextante.exceptions.UnsupportedOutputChannelException
#defineCharacteristics()} method.
,
IRasterLayer} for more info about valid values
protected FeatureStore buildOutPutStore(FeatureType featureType, int shapeType, String sextanteLayerName, String sextanteLayerLabel)
featureType
- protected FeatureStore buildOutPutStoreFromUnion(FeatureType featureType1, FeatureType featureType2, int shapeType, String sextanteLayerName, String sextanteLayerLabel)
featureType
- protected FeatureStore buildOutPutStoreFromUnion(FeatureType featureType1, FeatureType featureType2, int shapeType, String sextanteLayerName, String sextanteLayerLabel, String newField, Class<?> newFieldType)
featureType
- protected String checkAttrName(String name, int size)
name
- protected int getShapeType(FeatureStore storeLayer1) throws ReadException
FeatureStore
- sourceReadException
protected boolean isPoint(FeatureStore store) throws ReadException
store
- ReadException
protected boolean isPolygon(FeatureStore store) throws ReadException
store
- ReadException
protected boolean isLine(FeatureStore store) throws ReadException
store
- ReadException
protected boolean isUndefined(FeatureStore store) throws ReadException
store
- ReadException
public String getGeoProcessName()
GeoProcess
getGeoProcessName
in interface GeoProcess
protected void setProgressText(String sText)
es.unex.sextante.core.GeoAlgorithm
setProgressText
in class es.unex.sextante.core.GeoAlgorithm
sText
- the new progress textpublic boolean setProgress(int iStep, int iTotalNumberOfSteps)
es.unex.sextante.core.GeoAlgorithm
setProgress
in class es.unex.sextante.core.GeoAlgorithm
iStep
- the current stepiTotalNumberOfSteps
- the total number of stepsprotected SimpleTaskStatusDelegated getStatus()
public String getCommandLineName()
getCommandLineName
in class es.unex.sextante.core.GeoAlgorithm
public GeoProcessManager getGeoProcessManager()
GeoProcessManager
.GeoProcessManager
protected String getTranslation(String label)
label
- to translatepublic Class<? extends es.unex.sextante.gui.algorithm.GeoAlgorithmParametersPanel> getCustomParametersPanelClass()
public FeatureQuery getQueryFromAnalysisExtent(es.unex.sextante.core.AnalysisExtent e, FeatureStore store) throws CreateEnvelopeException, DataException
e
- store
- CreateEnvelopeException
DataException
public boolean existsOutPutFile(String resultLabel, int type)
resultLabel
- type
- zero shape and one tifpublic es.unex.sextante.core.ITaskMonitor getTaskMonitor()
public void setTaskMonitor(es.unex.sextante.core.ITaskMonitor task)