te::rp::ClassifierStrategy Class Referenceabstract

Raster classifier strategy base class. More...

#include <ClassifierStrategy.h>

Inheritance diagram for te::rp::ClassifierStrategy:
te::rp::ClassifierDummyStrategy te::rp::ClassifierEDStrategy te::rp::ClassifierEMStrategy te::rp::ClassifierISOSegStrategy te::rp::ClassifierKMeansStrategy te::rp::ClassifierMAPStrategy te::rp::ClassifierMaxLikelihoodStrategy te::rp::ClassifierSAMStrategy

Public Member Functions

void enableMultiThread (const bool &enable)
 Enable / disable the use of multiple threads. More...
 
void enableOutputPalette (const bool enabled)
 Enable (true) or disable (false) the creation of a paletted output raster. More...
 
void enableProgressInterface (const bool &enable)
 Enable / disable the progress interface. More...
 
void enableRasterCache (const bool &enable)
 Enable / disable the use of raster data cache. More...
 
virtual bool execute () _NOEXCEPT_OP(false)=0
 Executes the classification strategy. More...
 
const std::string & getErrorMessage () const
 Return the current error message if there is any. More...
 
void getMetaData (std::map< std::string, std::string > &metadata) const
 Returns strategy-dependent metadata. More...
 
virtual bool initialize (ClassifierStrategyParameters const *const strategyParams) _NOEXCEPT_OP(false)=0
 Initialize the classification strategy. More...
 
std::unique_ptr< te::rst::RasterreleaseOutputRaster ()
 Returns a pointer to the output raster or a void pointer if there is none. More...
 
void setInputPolygons (const std::vector< te::gm::Polygon *> &polygonsPtrs)
 Set the input polygons. More...
 
void setInputRaster (const te::rst::Raster &raster)
 Set the input raster. More...
 
void setInputRasterBands (const std::vector< unsigned int > &rasterBands)
 Set the input raste bandsr. More...
 
void setUserOutputPalette (std::vector< te::rst::BandProperty::ColorEntry > &userPalette)
 Set the output user palette. More...
 
virtual ~ClassifierStrategy ()
 Virtual destructor. More...
 

Protected Member Functions

 ClassifierStrategy ()
 Default constructor. More...
 
bool createOutputRaster (const std::vector< int > &bandsDataTypes, const std::vector< double > &noDataValues)
 Create the output raster using the EXPANSIBLE driver. More...
 
virtual void reset ()
 Reset to an initial state. More...
 
void setErrorMessage (const std::string &newErrorMessage)
 Set the current error message. More...
 
bool setOutputRasterPalette (const unsigned int size)
 Create and set the output raster palette folowing the current internal settings. More...
 

Protected Attributes

bool m_createRasterPalette
 Enable (true) or disable (false) the creation of a paletted output raster. More...
 
bool m_enableMultiThread
 Enable or disable the use multipe threads. More...
 
bool m_enableRasterCache
 Enable or disable the use a raster data cache. More...
 
std::vector< te::gm::Polygon * > const * m_inputPolygonsPtr
 Input polygons. More...
 
std::vector< unsigned int > m_inputRasterBands
 Input raster bands. More...
 
te::rst::Raster const * m_inputRasterPtr
 A pointer to the input raster. More...
 
std::map< std::string, std::string > m_metaData
 Strategy-dependent metadata. More...
 
std::unique_ptr< te::rst::Rasterm_outputRasterPtr
 A pointer to the output raster. More...
 
bool m_progressInterfaceEnabled
 Progress interface status. More...
 
std::vector< te::rst::BandProperty::ColorEntrym_userOutputPalette
 User output raster palette (it must be large enough to accomodate all classifyier generated classes or an empty vector to automatically generate an random palette. More...
 

Private Member Functions

 ClassifierStrategy (const ClassifierStrategy &rhs)
 Copy constructor. More...
 
const ClassifierStrategyoperator= (const ClassifierStrategy &rhs)
 Assignment operator. More...
 

Private Attributes

std::string m_errorMessage
 Current error message. More...
 

Detailed Description

Raster classifier strategy base class.

Definition at line 48 of file ClassifierStrategy.h.

Constructor & Destructor Documentation

◆ ~ClassifierStrategy()

virtual te::rp::ClassifierStrategy::~ClassifierStrategy ( )
virtual

Virtual destructor.

◆ ClassifierStrategy() [1/2]

te::rp::ClassifierStrategy::ClassifierStrategy ( )
protected

Default constructor.

◆ ClassifierStrategy() [2/2]

te::rp::ClassifierStrategy::ClassifierStrategy ( const ClassifierStrategy rhs)
private

Copy constructor.

Parameters
rhsThe right-hand side Raster.

Member Function Documentation

◆ createOutputRaster()

bool te::rp::ClassifierStrategy::createOutputRaster ( const std::vector< int > &  bandsDataTypes,
const std::vector< double > &  noDataValues 
)
protected

Create the output raster using the EXPANSIBLE driver.

Parameters
bandsDataTypesBands data types.
noDataValuesA vector of no-data values for each band.
Returns
true if ok,false on errors.
Note
A pointer to the created raster will be handled by m_outputRasterPtr.

◆ enableMultiThread()

void te::rp::ClassifierStrategy::enableMultiThread ( const bool &  enable)

Enable / disable the use of multiple threads.

Parameters
enableEnable (true) or disable (false) the use of multiple threads.

◆ enableOutputPalette()

void te::rp::ClassifierStrategy::enableOutputPalette ( const bool  enabled)

Enable (true) or disable (false) the creation of a paletted output raster.

Parameters
enabledEnable (true) or disable (false) the creation of a paletted output raster.

◆ enableProgressInterface()

void te::rp::ClassifierStrategy::enableProgressInterface ( const bool &  enable)

Enable / disable the progress interface.

Parameters
enableEnable (true) or disable (false) the progress interface.

◆ enableRasterCache()

void te::rp::ClassifierStrategy::enableRasterCache ( const bool &  enable)

Enable / disable the use of raster data cache.

Parameters
enableEnable (true) or disable (false) the use of raster cache.

◆ execute()

virtual bool te::rp::ClassifierStrategy::execute ( )
pure virtual

◆ getErrorMessage()

const std::string& te::rp::ClassifierStrategy::getErrorMessage ( ) const

Return the current error message if there is any.

Returns
Return the current error message if there is any.

◆ getMetaData()

void te::rp::ClassifierStrategy::getMetaData ( std::map< std::string, std::string > &  metadata) const

Returns strategy-dependent metadata.

Parameters
metadataStrategy-dependent metadata.

◆ initialize()

virtual bool te::rp::ClassifierStrategy::initialize ( ClassifierStrategyParameters const *const  strategyParams)
pure virtual

Initialize the classification strategy.

Parameters
strategyParamsA pointer to the user given specific classification strategy parameters ou NULL if no parameters are present.
Returns
true if OK, false on errors.

Implemented in te::rp::ClassifierISOSegStrategy, te::rp::ClassifierMaxLikelihoodStrategy, te::rp::ClassifierSAMStrategy, te::rp::ClassifierEMStrategy, te::rp::ClassifierMAPStrategy, te::rp::ClassifierEDStrategy, te::rp::ClassifierKMeansStrategy, and te::rp::ClassifierDummyStrategy.

◆ operator=()

const ClassifierStrategy& te::rp::ClassifierStrategy::operator= ( const ClassifierStrategy rhs)
private

Assignment operator.

Parameters
rhsThe right-hand-side copy that would be used to copy from.
Returns
A reference to this object.

◆ releaseOutputRaster()

std::unique_ptr< te::rst::Raster > te::rp::ClassifierStrategy::releaseOutputRaster ( )

Returns a pointer to the output raster or a void pointer if there is none.

Returns
Returns a pointer to the output raster or a void pointer if there is none.
Note
The caller of this method must take the ownership of the returned object.

◆ reset()

virtual void te::rp::ClassifierStrategy::reset ( )
protectedvirtual

Reset to an initial state.

◆ setErrorMessage()

void te::rp::ClassifierStrategy::setErrorMessage ( const std::string &  newErrorMessage)
protected

Set the current error message.

Parameters
newErrorMessageNew error message;

◆ setInputPolygons()

void te::rp::ClassifierStrategy::setInputPolygons ( const std::vector< te::gm::Polygon *> &  polygonsPtrs)

Set the input polygons.

Parameters
polygonsPtrsInput polygons pointers.
Note
The caller of this method must keep the ownership of the objects.

◆ setInputRaster()

void te::rp::ClassifierStrategy::setInputRaster ( const te::rst::Raster raster)

Set the input raster.

Parameters
rasterInput raster.

◆ setInputRasterBands()

void te::rp::ClassifierStrategy::setInputRasterBands ( const std::vector< unsigned int > &  rasterBands)

Set the input raste bandsr.

Parameters
rasterBandsInput raster bands.

◆ setOutputRasterPalette()

bool te::rp::ClassifierStrategy::setOutputRasterPalette ( const unsigned int  size)
protected

Create and set the output raster palette folowing the current internal settings.

Parameters
sizePalette size.
Returns
true if ok,false on errors.

◆ setUserOutputPalette()

void te::rp::ClassifierStrategy::setUserOutputPalette ( std::vector< te::rst::BandProperty::ColorEntry > &  userPalette)

Set the output user palette.

Parameters
userPaletteUser output raster palette (it must be large enough to accomodate all classifyier generated classes or an empty vector to automatically generate an random palette.

Member Data Documentation

◆ m_createRasterPalette

bool te::rp::ClassifierStrategy::m_createRasterPalette
protected

Enable (true) or disable (false) the creation of a paletted output raster.

Definition at line 164 of file ClassifierStrategy.h.

◆ m_enableMultiThread

bool te::rp::ClassifierStrategy::m_enableMultiThread
protected

Enable or disable the use multipe threads.

Definition at line 159 of file ClassifierStrategy.h.

◆ m_enableRasterCache

bool te::rp::ClassifierStrategy::m_enableRasterCache
protected

Enable or disable the use a raster data cache.

Definition at line 154 of file ClassifierStrategy.h.

◆ m_errorMessage

std::string te::rp::ClassifierStrategy::m_errorMessage
private

Current error message.

Definition at line 228 of file ClassifierStrategy.h.

◆ m_inputPolygonsPtr

std::vector<te::gm::Polygon*> const* te::rp::ClassifierStrategy::m_inputPolygonsPtr
protected

Input polygons.

Definition at line 179 of file ClassifierStrategy.h.

◆ m_inputRasterBands

std::vector<unsigned int> te::rp::ClassifierStrategy::m_inputRasterBands
protected

Input raster bands.

Definition at line 174 of file ClassifierStrategy.h.

◆ m_inputRasterPtr

te::rst::Raster const* te::rp::ClassifierStrategy::m_inputRasterPtr
protected

A pointer to the input raster.

Definition at line 144 of file ClassifierStrategy.h.

◆ m_metaData

std::map< std::string, std::string > te::rp::ClassifierStrategy::m_metaData
protected

Strategy-dependent metadata.

Definition at line 184 of file ClassifierStrategy.h.

◆ m_outputRasterPtr

std::unique_ptr< te::rst::Raster > te::rp::ClassifierStrategy::m_outputRasterPtr
protected

A pointer to the output raster.

Definition at line 169 of file ClassifierStrategy.h.

◆ m_progressInterfaceEnabled

bool te::rp::ClassifierStrategy::m_progressInterfaceEnabled
protected

Progress interface status.

Definition at line 149 of file ClassifierStrategy.h.

◆ m_userOutputPalette

std::vector< te::rst::BandProperty::ColorEntry > te::rp::ClassifierStrategy::m_userOutputPalette
protected

User output raster palette (it must be large enough to accomodate all classifyier generated classes or an empty vector to automatically generate an random palette.

Definition at line 189 of file ClassifierStrategy.h.


The documentation for this class was generated from the following file: