Class to generate samples points using random strategy. More...
#include <SamplePointsGeneratorRandom.h>
Public Member Functions | |
| void | execute () |
| Function to execute the kernel operation. More... | |
| SamplePointsGeneratorRandom () | |
| Default constructor. More... | |
| void | setEnvelope (te::gm::Envelope env) |
| void | setNumberOfPoints (int nPoints) |
| void | setOutputDataSetName (std::string dataSetName) |
| void | setOutputDataSource (te::da::DataSourcePtr ds) |
| void | setSRID (int srid) |
| virtual | ~SamplePointsGeneratorRandom () |
| Virtual destructor. More... | |
Protected Member Functions | |
| virtual std::unique_ptr< te::da::DataSetType > | createDataSetType () |
| virtual std::unique_ptr< te::mem::DataSet > | generateSamples (te::da::DataSetType *dsType) |
| te::gm::Point * | getPoint (const te::gm::Envelope *env) |
| void | saveDataSet (te::mem::DataSet *dataSet, te::da::DataSetType *dsType) |
Protected Attributes | |
| 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... | |
| int | m_srid |
| Attribute with spatial reference information. More... | |
| te::sa::SamplePointsGeneratorType | m_type |
| Generator Type. More... | |
Class to generate samples points using random strategy.
Definition at line 51 of file SamplePointsGeneratorRandom.h.
| te::sa::SamplePointsGeneratorRandom::SamplePointsGeneratorRandom | ( | ) |
Default constructor.
Definition at line 40 of file SamplePointsGeneratorRandom.cpp.
References te::sa::SamplePointsGeneratorAbstract::m_type, te::sa::Random, and ~SamplePointsGeneratorRandom().
|
virtualdefault |
Virtual destructor.
Referenced by SamplePointsGeneratorRandom().
|
protectedvirtual |
Function used to create the output dataset type
Implements te::sa::SamplePointsGeneratorAbstract.
Definition at line 53 of file SamplePointsGeneratorRandom.cpp.
References te::da::PrimaryKey::add(), te::dt::INT32_TYPE, te::sa::SamplePointsGeneratorAbstract::m_outputDataSetName, te::sa::SamplePointsGeneratorAbstract::m_srid, te::gm::PointType, TE_SA_SPG_ATTR_GEOM_NAME, TE_SA_SPG_ATTR_ID_NAME, and TE_SA_SPG_ATTR_PK_NAME.
|
inherited |
Function to execute the kernel operation.
Definition at line 42 of file SamplePointsGeneratorAbstract.cpp.
References te::sa::SamplePointsGeneratorAbstract::createDataSetType(), te::sa::SamplePointsGeneratorAbstract::generateSamples(), and te::sa::SamplePointsGeneratorAbstract::saveDataSet().
Referenced by te::sa::SamplePointsGeneratorDialog::onOkPushButtonClicked().
|
protectedvirtual |
Function used to create the output data
Implements te::sa::SamplePointsGeneratorAbstract.
Definition at line 74 of file SamplePointsGeneratorRandom.cpp.
References ds, te::sa::SamplePointsGeneratorAbstract::getPoint(), te::common::TaskProgress::isActive(), te::sa::SamplePointsGeneratorAbstract::m_env, m_nPoints, te::common::TaskProgress::pulse(), te::mem::DataSetItem::setGeometry(), te::mem::DataSetItem::setInt32(), te::common::TaskProgress::setMessage(), te::common::TaskProgress::setTotalSteps(), TE_SA_SPG_ATTR_GEOM_NAME, TE_SA_SPG_ATTR_ID_NAME, and TE_TR.
|
protectedinherited |
Function used to generate a randon point inside a defined envelope
Definition at line 86 of file SamplePointsGeneratorAbstract.cpp.
References te::gm::Envelope::getLowerLeftX(), te::gm::Envelope::getLowerLeftY(), te::gm::Envelope::getUpperRightX(), te::gm::Envelope::getUpperRightY(), te::sa::SamplePointsGeneratorAbstract::m_distReal, te::sa::SamplePointsGeneratorAbstract::m_gen, te::sa::SamplePointsGeneratorAbstract::m_srid, p, te::gm::Point::setX(), and te::gm::Point::setY().
Referenced by generateSamples(), and te::sa::SamplePointsGeneratorStratified::getPointInGeometry().
|
protectedinherited |
Function used to save the output dataset
Definition at line 71 of file SamplePointsGeneratorAbstract.cpp.
References te::sa::SamplePointsGeneratorAbstract::m_ds, te::sa::SamplePointsGeneratorAbstract::m_outputDataSetName, and te::mem::DataSet::moveBeforeFirst().
Referenced by te::sa::SamplePointsGeneratorAbstract::execute().
|
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::SamplePointsGeneratorRandom::setNumberOfPoints | ( | int | nPoints | ) |
Function used to set the number of points to be generated
Definition at line 48 of file SamplePointsGeneratorRandom.cpp.
References m_nPoints.
|
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().
|
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().
|
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().
|
protectedinherited |
Definition at line 114 of file SamplePointsGeneratorAbstract.h.
Referenced by te::sa::SamplePointsGeneratorAbstract::getPoint(), and te::sa::SamplePointsGeneratorAbstract::SamplePointsGeneratorAbstract().
|
protectedinherited |
Pointer to the output datasource.
Definition at line 106 of file SamplePointsGeneratorAbstract.h.
Referenced by te::sa::SamplePointsGeneratorAbstract::saveDataSet(), and te::sa::SamplePointsGeneratorAbstract::setOutputDataSource().
|
protectedinherited |
Attribute used to restrict the area to generate the samples.
Definition at line 104 of file SamplePointsGeneratorAbstract.h.
Referenced by generateSamples(), and te::sa::SamplePointsGeneratorAbstract::setEnvelope().
|
protectedinherited |
Definition at line 112 of file SamplePointsGeneratorAbstract.h.
Referenced by te::sa::SamplePointsGeneratorStratified::generateSamples(), and te::sa::SamplePointsGeneratorAbstract::getPoint().
|
protected |
Attribute used to define the number of points to be generated.
Definition at line 76 of file SamplePointsGeneratorRandom.h.
Referenced by generateSamples(), and setNumberOfPoints().
|
protectedinherited |
Attribute that defines the output dataset name.
Definition at line 108 of file SamplePointsGeneratorAbstract.h.
Referenced by createDataSetType(), te::sa::SamplePointsGeneratorStratified::createDataSetType(), te::sa::SamplePointsGeneratorAbstract::saveDataSet(), and te::sa::SamplePointsGeneratorAbstract::setOutputDataSetName().
|
protectedinherited |
Attribute with spatial reference information.
Definition at line 102 of file SamplePointsGeneratorAbstract.h.
Referenced by createDataSetType(), te::sa::SamplePointsGeneratorStratified::createDataSetType(), te::sa::SamplePointsGeneratorAbstract::getPoint(), and te::sa::SamplePointsGeneratorAbstract::setSRID().
|
protectedinherited |
Generator Type.
Definition at line 110 of file SamplePointsGeneratorAbstract.h.
Referenced by SamplePointsGeneratorRandom(), and te::sa::SamplePointsGeneratorStratified::SamplePointsGeneratorStratified().