27 #include "../geometry/Envelope.h"
28 #include "../geometry/Polygon.h"
29 #include "../raster/Raster.h"
30 #include "../raster/RasterFactory.h"
31 #include "../raster/Band.h"
32 #include "../raster/BandProperty.h"
33 #include "../raster/Grid.h"
42 : m_classifierStrategyParamsPtr(0)
48 : m_classifierStrategyParamsPtr(0)
62 if(m_classifierStrategyParamsPtr)
64 delete m_classifierStrategyParamsPtr;
65 m_classifierStrategyParamsPtr = 0;
73 return m_classifierStrategyParamsPtr;
79 m_inputRasterBands.clear();
80 m_inputPolygons.clear();
81 m_strategyName.clear();
83 if(m_classifierStrategyParamsPtr)
85 delete m_classifierStrategyParamsPtr;
86 m_classifierStrategyParamsPtr = 0;
130 m_outputRasterPtr.reset();
160 if(!m_instanceInitialized)
167 std::vector<te::rst::BandProperty*> bandsProperties;
169 m_inputParameters.m_inputRasterBands[0])->getProperty())));
172 bandsProperties[0]->m_noDataValue = 0;
179 "Output raster creation error");
185 "Unable to initialize the classification strategy");
186 TERP_TRUE_OR_RETURN_FALSE(strategyPtr->execute(*m_inputParameters.m_inputRasterPtr, m_inputParameters.m_inputRasterBands,
187 m_inputParameters.m_inputPolygons, *outputParamsPtr->
m_outputRasterPtr, 0,
true),
188 "Unable to execute the classification strategy");
195 m_instanceInitialized =
false;
197 m_inputParameters.reset();
216 "Invalid raster bands number");
221 "Invalid raster bands" );
227 "Raster and Polygons does not fit");
231 m_instanceInitialized =
true;
233 m_inputParameters = *inputParamsPtr;
240 return m_instanceInitialized;
virtual AbstractParameters * clone() const =0
Create a clone copy of this instance.
te::gm::Envelope * getExtent()
Returns the geographic extension of the raster data.
OutputParameters()
Default constructor.
Index into a lookup table.
std::auto_ptr< te::rst::Raster > m_outputRasterPtr
A pointer to the generated output raster (label image).
A raster band description.
bool execute(AlgorithmOutputParameters &outputParams)
Executes the algorithm using the supplied parameters.
Raster Processing algorithm output parameters base interface.
Classifier output parameters.
#define TERP_TRUE_OR_RETURN_FALSE(value, message)
Checks if value is true. For false values a warning message will be logged and a return of context wi...
const Algorithm & operator=(const Algorithm &)
te::common::AccessPolicy getAccessPolicy() const
Returns the raster access policy.
const Classifier::OutputParameters & operator=(const Classifier::OutputParameters ¶ms)
virtual std::size_t getNumberOfBands() const =0
Returns the number of bands (dimension of cells attribute values) in the raster.
Raster strategy parameters base class.
Raster Processing algorithm base interface class.
static te::rp::ClassifierStrategy * make(const std::string &factoryKey)
It creates an object with the appropriated factory.
Raster classifier strategy factory base class.
Abstract parameters base interface.
bool m_instanceInitialized
Is this instance already initialized?
Configuration flags for the Raster Processing module of TerraLib.
te::common::AbstractParameters * clone() const
Create a clone copy of this instance.
void reset()
Clear all internal allocated resources and reset the parameters instance to its initial state...
bool initialize(const AlgorithmInputParameters &inputParams)
Initialize the algorithm instance making it ready for execution.
static Raster * make()
It creates and returns an empty raster with default raster driver.
Raster classifier strategy base class.
void reset()
Clear all internal allocated objects and reset the algorithm to its initial state.
std::map< std::string, std::string > m_rInfo
The necessary information to create the raster (as described in te::raster::RasterFactory).
A rectified grid is the spatial support for raster data.
std::string m_rType
Output raster data source type (as described in te::raster::RasterFactory ).
bool isInitialized() const
Returns true if the algorithm instance is initialized and ready for execution.