Class to generate samples points using stratified strategy. More...
#include <SamplePointsGeneratorStratified.h>
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::auto_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::auto_ptr< te::da::DataSetType > | createDataSetType () |
virtual std::auto_ptr< te::mem::DataSet > | generateSamples (te::da::DataSetType *dsType) |
te::gm::Point * | getPoint (const te::gm::Envelope *env) |
te::gm::Point * | getPointInGeometry (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::auto_ptr< te::da::DataSet > | m_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... | |
Class to generate samples points using stratified strategy.
Definition at line 58 of file SamplePointsGeneratorStratified.h.
te::sa::SamplePointsGeneratorStratified::SamplePointsGeneratorStratified | ( | ) |
Default constructor.
Definition at line 44 of file SamplePointsGeneratorStratified.cpp.
References te::sa::SamplePointsGeneratorAbstract::m_type, and te::sa::Stratified.
|
virtual |
Virtual destructor.
Definition at line 49 of file SamplePointsGeneratorStratified.cpp.
References te::common::FreeContents().
|
protected |
Function used to create the class map
Definition at line 244 of file SamplePointsGeneratorStratified.cpp.
References te::dt::GEOMETRY_TYPE, and te::da::GetFirstPropertyPos().
|
protectedvirtual |
Function used to create the output dataset type
Implements te::sa::SamplePointsGeneratorAbstract.
Definition at line 101 of file SamplePointsGeneratorStratified.cpp.
References te::da::PrimaryKey::add(), te::dt::INT32_TYPE, te::gm::PointType, te::dt::STRING_TYPE, TE_SA_SPG_ATTR_CLASS_NAME, 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 43 of file SamplePointsGeneratorAbstract.cpp.
Referenced by te::sa::SamplePointsGeneratorDialog::onOkPushButtonClicked().
|
protectedvirtual |
Function used to create the output data
Implements te::sa::SamplePointsGeneratorAbstract.
Definition at line 126 of file SamplePointsGeneratorStratified.cpp.
References te::sa::GetArea(), te::common::TaskProgress::isActive(), te::common::TaskProgress::pulse(), te::mem::DataSetItem::setGeometry(), te::mem::DataSetItem::setInt32(), te::common::TaskProgress::setMessage(), te::mem::DataSetItem::setString(), te::common::TaskProgress::setTotalSteps(), TE_SA_SPG_ATTR_CLASS_NAME, TE_SA_SPG_ATTR_GEOM_NAME, TE_SA_SPG_ATTR_ID_NAME, and TE_TR.
std::vector< std::string > te::sa::SamplePointsGeneratorStratified::getClassNames | ( | ) |
Function used to get the names for the generated classes
Definition at line 85 of file SamplePointsGeneratorStratified.cpp.
|
protectedinherited |
Function used to generate a randon point inside a defined envelope
Definition at line 87 of file SamplePointsGeneratorAbstract.cpp.
References te::gm::Envelope::getLowerLeftX(), te::gm::Envelope::getLowerLeftY(), te::gm::Envelope::getUpperRightX(), te::gm::Envelope::getUpperRightY(), te::gm::Point::setX(), and te::gm::Point::setY().
|
protected |
Function used to generate a randon point inside a defined geometry
Definition at line 277 of file SamplePointsGeneratorStratified.cpp.
References te::gm::Geometry::getMBR(), and te::gm::Geometry::within().
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 80 of file SamplePointsGeneratorStratified.cpp.
|
protectedinherited |
Function used to save the output dataset
Definition at line 72 of file SamplePointsGeneratorAbstract.cpp.
References te::mem::DataSet::moveBeforeFirst().
|
inherited |
Function used to set the envelope parameter
Definition at line 57 of file SamplePointsGeneratorAbstract.cpp.
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 75 of file SamplePointsGeneratorStratified.cpp.
void te::sa::SamplePointsGeneratorStratified::setInputDataSet | ( | std::auto_ptr< te::da::DataSet > | dataSet | ) |
Function used to set the input dataset
Definition at line 70 of file SamplePointsGeneratorStratified.cpp.
void te::sa::SamplePointsGeneratorStratified::setNumberOfPoints | ( | int | nPoints | ) |
Function used to set the number of points to be generated
Definition at line 65 of file SamplePointsGeneratorStratified.cpp.
|
inherited |
Function used to set the output dataset name parameter
Definition at line 62 of file SamplePointsGeneratorAbstract.cpp.
Referenced by te::sa::SamplePointsGeneratorDialog::onOkPushButtonClicked().
|
inherited |
Function used to set the output data source parameter
Definition at line 67 of file SamplePointsGeneratorAbstract.cpp.
Referenced by te::sa::SamplePointsGeneratorDialog::onOkPushButtonClicked().
|
inherited |
Function used to set the envelope parameter
Definition at line 52 of file SamplePointsGeneratorAbstract.cpp.
Referenced by te::sa::SamplePointsGeneratorDialog::onOkPushButtonClicked().
|
protected |
Attribute used to get from input data the selected attribute.
Definition at line 105 of file SamplePointsGeneratorStratified.h.
|
protected |
Attribute with polygons for each class from input dataset.
Definition at line 109 of file SamplePointsGeneratorStratified.h.
|
protected |
Attribute with input data.
Definition at line 103 of file SamplePointsGeneratorStratified.h.
|
protected |
Definition at line 111 of file SamplePointsGeneratorStratified.h.
|
protectedinherited |
Definition at line 114 of file SamplePointsGeneratorAbstract.h.
Referenced by te::sa::SamplePointsGeneratorAbstract::SamplePointsGeneratorAbstract().
|
protectedinherited |
Pointer to the output datasource.
Definition at line 106 of file SamplePointsGeneratorAbstract.h.
|
protectedinherited |
Attribute used to restrict the area to generate the samples.
Definition at line 104 of file SamplePointsGeneratorAbstract.h.
|
protectedinherited |
Definition at line 112 of file SamplePointsGeneratorAbstract.h.
|
protected |
Attribute used to define the number of points to be generated.
Definition at line 101 of file SamplePointsGeneratorStratified.h.
|
protectedinherited |
Attribute that defines the output dataset name.
Definition at line 108 of file SamplePointsGeneratorAbstract.h.
|
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.
|
protectedinherited |
Attribute with spatial reference information.
Definition at line 102 of file SamplePointsGeneratorAbstract.h.
|
protectedinherited |
Generator Type.
Definition at line 110 of file SamplePointsGeneratorAbstract.h.
Referenced by te::sa::SamplePointsGeneratorRandom::SamplePointsGeneratorRandom(), and SamplePointsGeneratorStratified().