te::sa::SamplePointsGeneratorStratified Class Reference

Class to generate samples points using stratified strategy. More...

#include <SamplePointsGeneratorStratified.h>

Inheritance diagram for te::sa::SamplePointsGeneratorStratified:
te::sa::SamplePointsGeneratorAbstract

Public Member Functions

void execute ()
 Function to execute the kernel operation. More...
 
std::vector< std::string > getClassNames ()
 
void isProportionalToArea (bool isProp)
 
 SamplePointsGeneratorStratified ()
 Default constructor. More...
 
void setEnvelope (te::gm::Envelope env)
 
void setInputAttributeName (std::string attrName)
 
void setInputDataSet (std::unique_ptr< te::da::DataSet > dataSet)
 
void setNumberOfPoints (int nPoints)
 
void setOutputDataSetName (std::string dataSetName)
 
void setOutputDataSource (te::da::DataSourcePtr ds)
 
void setSRID (int srid)
 
virtual ~SamplePointsGeneratorStratified ()
 Virtual destructor. More...
 

Protected Member Functions

void createClassMap ()
 
virtual std::unique_ptr< te::da::DataSetTypecreateDataSetType ()
 
virtual std::unique_ptr< te::mem::DataSetgenerateSamples (te::da::DataSetType *dsType)
 
te::gm::PointgetPoint (const te::gm::Envelope *env)
 
te::gm::PointgetPointInGeometry (te::gm::Geometry *g)
 
void saveDataSet (te::mem::DataSet *dataSet, te::da::DataSetType *dsType)
 

Protected Attributes

std::string m_attrName
 Attribute used to get from input data the selected attribute. More...
 
std::map< std::string, std::vector< te::gm::Geometry * > > m_classMap
 Attribute with polygons for each class from input dataset. More...
 
std::unique_ptr< te::da::DataSetm_dataSet
 Attribute with input data. More...
 
boost::random::uniform_int_distribution m_distInt
 
boost::random::uniform_real_distribution m_distReal
 
te::da::DataSourcePtr m_ds
 Pointer to the output datasource. More...
 
te::gm::Envelope m_env
 Attribute used to restrict the area to generate the samples. More...
 
boost::random::mt19937 m_gen
 
int m_nPoints
 Attribute used to define the number of points to be generated. More...
 
std::string m_outputDataSetName
 Attribute that defines the output dataset name. More...
 
bool m_propToArea
 Attribute used to indicate if the number of samples has to be proportional to the area. More...
 
int m_srid
 Attribute with spatial reference information. More...
 
te::sa::SamplePointsGeneratorType m_type
 Generator Type. More...
 

Detailed Description

Class to generate samples points using stratified strategy.

Definition at line 58 of file SamplePointsGeneratorStratified.h.

Constructor & Destructor Documentation

te::sa::SamplePointsGeneratorStratified::SamplePointsGeneratorStratified ( )

Default constructor.

Definition at line 44 of file SamplePointsGeneratorStratified.cpp.

References te::sa::SamplePointsGeneratorAbstract::m_type, and te::sa::Stratified.

te::sa::SamplePointsGeneratorStratified::~SamplePointsGeneratorStratified ( )
virtual

Virtual destructor.

Definition at line 50 of file SamplePointsGeneratorStratified.cpp.

References te::common::FreeContents(), and m_classMap.

Member Function Documentation

void te::sa::SamplePointsGeneratorStratified::createClassMap ( )
protected

Function used to create the class map

Definition at line 245 of file SamplePointsGeneratorStratified.cpp.

References te::dt::GEOMETRY_TYPE, te::da::GetFirstPropertyPos(), m_attrName, m_classMap, and m_dataSet.

Referenced by generateSamples().

void te::sa::SamplePointsGeneratorAbstract::execute ( )
inherited
std::vector< std::string > te::sa::SamplePointsGeneratorStratified::getClassNames ( )

Function used to get the names for the generated classes

Definition at line 86 of file SamplePointsGeneratorStratified.cpp.

References m_classMap.

te::gm::Point * te::sa::SamplePointsGeneratorStratified::getPointInGeometry ( te::gm::Geometry g)
protected

Function used to generate a randon point inside a defined geometry

Definition at line 278 of file SamplePointsGeneratorStratified.cpp.

References te::gm::Geometry::getMBR(), te::sa::SamplePointsGeneratorAbstract::getPoint(), p, and te::gm::Geometry::within().

Referenced by generateSamples().

void te::sa::SamplePointsGeneratorStratified::isProportionalToArea ( bool  isProp)

Function used to set if the number of samples has to be proportional to the area

Definition at line 81 of file SamplePointsGeneratorStratified.cpp.

References m_propToArea.

void te::sa::SamplePointsGeneratorAbstract::saveDataSet ( te::mem::DataSet dataSet,
te::da::DataSetType dsType 
)
protectedinherited
void te::sa::SamplePointsGeneratorAbstract::setEnvelope ( te::gm::Envelope  env)
inherited

Function used to set the envelope parameter

Definition at line 56 of file SamplePointsGeneratorAbstract.cpp.

References te::sa::SamplePointsGeneratorAbstract::m_env.

Referenced by te::sa::SamplePointsGeneratorDialog::onOkPushButtonClicked().

void te::sa::SamplePointsGeneratorStratified::setInputAttributeName ( std::string  attrName)

Function used to set attribute from input data selected to generate the samples

Definition at line 76 of file SamplePointsGeneratorStratified.cpp.

References m_attrName.

void te::sa::SamplePointsGeneratorStratified::setInputDataSet ( std::unique_ptr< te::da::DataSet dataSet)

Function used to set the input dataset

Definition at line 71 of file SamplePointsGeneratorStratified.cpp.

References m_dataSet.

void te::sa::SamplePointsGeneratorStratified::setNumberOfPoints ( int  nPoints)

Function used to set the number of points to be generated

Definition at line 66 of file SamplePointsGeneratorStratified.cpp.

References m_nPoints.

void te::sa::SamplePointsGeneratorAbstract::setOutputDataSetName ( std::string  dataSetName)
inherited

Function used to set the output dataset name parameter

Definition at line 61 of file SamplePointsGeneratorAbstract.cpp.

References te::sa::SamplePointsGeneratorAbstract::m_outputDataSetName.

Referenced by te::sa::SamplePointsGeneratorDialog::onOkPushButtonClicked().

void te::sa::SamplePointsGeneratorAbstract::setOutputDataSource ( te::da::DataSourcePtr  ds)
inherited

Function used to set the output data source parameter

Definition at line 66 of file SamplePointsGeneratorAbstract.cpp.

References ds, and te::sa::SamplePointsGeneratorAbstract::m_ds.

Referenced by te::sa::SamplePointsGeneratorDialog::onOkPushButtonClicked().

void te::sa::SamplePointsGeneratorAbstract::setSRID ( int  srid)
inherited

Function used to set the envelope parameter

Definition at line 51 of file SamplePointsGeneratorAbstract.cpp.

References te::sa::SamplePointsGeneratorAbstract::m_srid.

Referenced by te::sa::SamplePointsGeneratorDialog::onOkPushButtonClicked().

Member Data Documentation

std::string te::sa::SamplePointsGeneratorStratified::m_attrName
protected

Attribute used to get from input data the selected attribute.

Definition at line 105 of file SamplePointsGeneratorStratified.h.

Referenced by createClassMap(), and setInputAttributeName().

std::map<std::string, std::vector<te::gm::Geometry*> > te::sa::SamplePointsGeneratorStratified::m_classMap
protected

Attribute with polygons for each class from input dataset.

Definition at line 109 of file SamplePointsGeneratorStratified.h.

Referenced by createClassMap(), generateSamples(), getClassNames(), and ~SamplePointsGeneratorStratified().

std::unique_ptr<te::da::DataSet> te::sa::SamplePointsGeneratorStratified::m_dataSet
protected

Attribute with input data.

Definition at line 103 of file SamplePointsGeneratorStratified.h.

Referenced by createClassMap(), and setInputDataSet().

boost::random::uniform_int_distribution te::sa::SamplePointsGeneratorStratified::m_distInt
protected

Definition at line 111 of file SamplePointsGeneratorStratified.h.

Referenced by generateSamples().

boost::random::uniform_real_distribution te::sa::SamplePointsGeneratorAbstract::m_distReal
protectedinherited
te::da::DataSourcePtr te::sa::SamplePointsGeneratorAbstract::m_ds
protectedinherited
te::gm::Envelope te::sa::SamplePointsGeneratorAbstract::m_env
protectedinherited

Attribute used to restrict the area to generate the samples.

Definition at line 104 of file SamplePointsGeneratorAbstract.h.

Referenced by te::sa::SamplePointsGeneratorRandom::generateSamples(), and te::sa::SamplePointsGeneratorAbstract::setEnvelope().

boost::random::mt19937 te::sa::SamplePointsGeneratorAbstract::m_gen
protectedinherited
int te::sa::SamplePointsGeneratorStratified::m_nPoints
protected

Attribute used to define the number of points to be generated.

Definition at line 101 of file SamplePointsGeneratorStratified.h.

Referenced by generateSamples(), and setNumberOfPoints().

std::string te::sa::SamplePointsGeneratorAbstract::m_outputDataSetName
protectedinherited
bool te::sa::SamplePointsGeneratorStratified::m_propToArea
protected

Attribute used to indicate if the number of samples has to be proportional to the area.

Definition at line 107 of file SamplePointsGeneratorStratified.h.

Referenced by generateSamples(), and isProportionalToArea().

int te::sa::SamplePointsGeneratorAbstract::m_srid
protectedinherited
te::sa::SamplePointsGeneratorType te::sa::SamplePointsGeneratorAbstract::m_type
protectedinherited

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