This is the namespace for the Statistics module. More...
Classes | |
class | Module |
This singleton defines the TerraLib Qt Widgets module entry. More... | |
struct | NumericStatisticalSummary |
A structure to hold the set of statistics from a set of numerical values. More... | |
class | StatisticsDialog |
struct | StringStatisticalSummary |
A structure to hold the set of statistics from a set of categorical (sample) values. More... | |
Enumerations | |
enum | StatisticalSummary { MIN_VALUE, MAX_VALUE, MEAN, SUM, COUNT, VALID_COUNT, STANDARD_DEVIATION, VARIANCE, SKEWNESS, KURTOSIS, AMPLITUDE, MEDIAN, VAR_COEFF, MODE, PERCENT_EACH_CLASS_BY_AREA, PERCENT_TOTAL_AREA } |
Define grouping functions type. More... | |
Functions | |
TESTATEXPORT std::vector< double > | GetNumericData (te::da::DataSet *dataSet, const std::string propName) |
Returns the values of a numeric type property in a vector of values. More... | |
TESTATEXPORT void | GetNumericStatisticalSummary (std::vector< double > &values, te::stat::NumericStatisticalSummary &ss, double nullVal) |
TESTATEXPORT void | GetNumericStatisticalSummary (std::vector< double > &values, te::stat::NumericStatisticalSummary &ss) |
TESTATEXPORT void | GetNumericStatisticalSummaryQuery (const std::string &inDataset, te::da::DataSource *inDatasource, const std::string &propName, te::stat::NumericStatisticalSummary &ss) |
TESTATEXPORT void | GetPercentOfEachClassByArea (std::vector< double > &values, double &resolutionX, double &resolutionY, double &area, te::stat::NumericStatisticalSummary &ss, bool fullIntersection=true) |
TESTATEXPORT std::string | GetStatSummaryFullName (const int &e) |
Get the statistical parameter full name ffrom its enumerator. More... | |
TESTATEXPORT std::string | GetStatSummaryShortName (const int &e) |
Get the statistical parameter short name from its enumerator. More... | |
TESTATEXPORT std::vector< std::string > | GetStringData (te::da::DataSet *dataSet, const std::string propName) |
Returns the values of a string type property in a vector of values. More... | |
TESTATEXPORT void | GetStringStatisticalSummary (std::vector< std::string > &values, te::stat::StringStatisticalSummary &ss) |
TESTATEXPORT void | GetStringStatisticalSummary (std::vector< std::string > &values, te::stat::StringStatisticalSummary &ss, const std::string &nullValue) |
TESTATEXPORT void | GetStringStatisticalSummaryQuery (const std::string &inDataset, te::da::DataSource *inDatasource, const std::string &propName, te::stat::StringStatisticalSummary &ss) |
TESTATEXPORT std::vector< double > | Mode (const std::vector< double > &values) |
TESTATEXPORT std::string | Mode (const std::vector< std::string > &values) |
This is the namespace for the Statistics module.
Define grouping functions type.
enum StatisticalSummary { MIN_VALUE, //!< Minimum value. MAX_VALUE, //!< Maximum value. MEAN, //!< Mean. SUM, //!< Sum of values. COUNT, //!< Total number of values. VALID_COUNT, //!< Total not null values. STANDARD_DEVIATION, //!< Standard deviation. VARIANCE, //!< Variance. SKEWNESS, //!< Skewness. KURTOSIS, //!< Kurtosis. AMPLITUDE, //!< Amplitude. MEDIAN, //!< Median. VAR_COEFF, //!< Coefficient variation. MODE //!< Mode. };
std::vector< double > te::stat::GetNumericData | ( | te::da::DataSet * | dataSet, |
const std::string | propName | ||
) |
Returns the values of a numeric type property in a vector of values.
It returns only the non-empty values.
dataSet | A pointer to the dataset. Do not pass null. |
propName | The propoerty name. Do not pass empty. |
Definition at line 170 of file Utils.cpp.
References te::dt::DOUBLE_TYPE, te::dt::FLOAT_TYPE, te::da::DataSet::getDouble(), te::da::DataSet::getFloat(), te::da::DataSet::getInt16(), te::da::DataSet::getInt32(), te::da::DataSet::getInt64(), te::da::DataSet::getNumeric(), te::da::DataSet::getNumProperties(), te::da::DataSet::getPropertyDataType(), te::da::DataSet::getPropertyName(), te::dt::INT16_TYPE, te::dt::INT32_TYPE, te::dt::INT64_TYPE, te::da::DataSet::isNull(), te::da::DataSet::moveFirst(), te::da::DataSet::moveNext(), and te::dt::NUMERIC_TYPE.
Referenced by te::qt::widgets::createNormalDistribution(), GetNumericStatisticalSummaryQuery(), and te::stat::StatisticsDialog::setStatistics().
void te::stat::GetNumericStatisticalSummary | ( | std::vector< double > & | values, |
te::stat::NumericStatisticalSummary & | ss, | ||
double | nullVal | ||
) |
Fills the summary statistics structure from a set of numerical values.
values | a vector of numerical values. Do not pass empty. |
ss | to return the statistical summary. |
nullVal | a value to be considered as non-value or invalid value. |
Definition at line 92 of file SummaryFunctions.cpp.
References te::stat::NumericStatisticalSummary::m_count, and te::stat::NumericStatisticalSummary::m_validCount.
Referenced by buildNumericFrequencies(), buildSummarizedScatter(), te::vp::AggregationMemory::calculateNumStats(), te::qt::widgets::createNormalDistribution(), te::attributefill::VectorToVectorMemory::getClassWithHighestOccurrence(), GetNumericStatisticalSummaryQuery(), te::rp::RasterAttributes::getStatistics(), te::attributefill::VectorToVectorMemory::run(), and te::stat::StatisticsDialog::setStatistics().
void te::stat::GetNumericStatisticalSummary | ( | std::vector< double > & | values, |
te::stat::NumericStatisticalSummary & | ss | ||
) |
Fills the summary statistics structure from a set of numerical values.
values | a vector of numerical values. Do not pass empty. |
ss | to return the statistical summary. |
Definition at line 108 of file SummaryFunctions.cpp.
References te::stat::NumericStatisticalSummary::m_amplitude, te::stat::NumericStatisticalSummary::m_count, te::stat::NumericStatisticalSummary::m_kurtosis, te::stat::NumericStatisticalSummary::m_maxVal, te::stat::NumericStatisticalSummary::m_mean, te::stat::NumericStatisticalSummary::m_median, te::stat::NumericStatisticalSummary::m_minVal, te::stat::NumericStatisticalSummary::m_mode, te::stat::NumericStatisticalSummary::m_skewness, te::stat::NumericStatisticalSummary::m_stdDeviation, te::stat::NumericStatisticalSummary::m_sum, te::stat::NumericStatisticalSummary::m_validCount, te::stat::NumericStatisticalSummary::m_varCoeff, te::stat::NumericStatisticalSummary::m_variance, and Mode().
void te::stat::GetNumericStatisticalSummaryQuery | ( | const std::string & | inDataset, |
te::da::DataSource * | inDatasource, | ||
const std::string & | propName, | ||
te::stat::NumericStatisticalSummary & | ss | ||
) |
Fills the summary statistics structure of a given numerical property from a dataset.
inDataset | a dataset name. |
inDatasource | a pointer to a datasource. Do not pass null. |
propName | the name of the property to be summarized. |
ss | to return the statistical summary. |
Definition at line 395 of file SummaryFunctions.cpp.
References te::da::DataSource::dataSetExists(), te::da::DataSource::getCapabilities(), te::da::DataSource::getDataSet(), GetNumericData(), GetNumericStatisticalSummary(), te::stat::NumericStatisticalSummary::m_amplitude, te::stat::NumericStatisticalSummary::m_count, te::stat::NumericStatisticalSummary::m_maxVal, te::stat::NumericStatisticalSummary::m_mean, te::stat::NumericStatisticalSummary::m_minVal, te::stat::NumericStatisticalSummary::m_stdDeviation, te::stat::NumericStatisticalSummary::m_sum, te::stat::NumericStatisticalSummary::m_variance, te::da::DataSource::query(), te::sa::Sum(), and te::da::DataSourceCapabilities::supportsPreparedQueryAPI().
void te::stat::GetPercentOfEachClassByArea | ( | std::vector< double > & | values, |
double & | resolutionX, | ||
double & | resolutionY, | ||
double & | area, | ||
te::stat::NumericStatisticalSummary & | ss, | ||
bool | fullIntersection = true |
||
) |
Fills the percentage of each class by area.
values | a vector of numerical values, representing pixels from a raster. Do not pass empty. |
resolutionX | a raster horizontal (x-axis) resolution. |
resolutionY | a raster vertical (y-axis) resolution. |
area | area of a geometry that intersects the raster. |
ss | to return the percentage of each class by area. |
fullIntersection | set as true if geometry is all inside of the raster box. |
Definition at line 153 of file SummaryFunctions.cpp.
References te::stat::NumericStatisticalSummary::m_percentEachClass.
Referenced by te::attributefill::RasterToVector::run().
std::string te::stat::GetStatSummaryFullName | ( | const int & | e | ) |
Get the statistical parameter full name ffrom its enumerator.
e | The enumerator. |
Definition at line 94 of file Utils.cpp.
References AMPLITUDE, COUNT, KURTOSIS, MAX_VALUE, MEAN, MEDIAN, MIN_VALUE, MODE, PERCENT_EACH_CLASS_BY_AREA, PERCENT_TOTAL_AREA, SKEWNESS, STANDARD_DEVIATION, SUM, TE_TR, VALID_COUNT, VAR_COEFF, and VARIANCE.
Referenced by te::vp::AggregationDialog::setStatisticalSummary(), te::vp::AggregationDialog::setStatisticalSummaryMap(), te::stat::StatisticsDialog::setStatistics(), and updateSummary().
std::string te::stat::GetStatSummaryShortName | ( | const int & | e | ) |
Get the statistical parameter short name from its enumerator.
e | The enumerator. |
Definition at line 37 of file Utils.cpp.
References AMPLITUDE, COUNT, KURTOSIS, MAX_VALUE, MEAN, MEDIAN, MIN_VALUE, MODE, PERCENT_EACH_CLASS_BY_AREA, PERCENT_TOTAL_AREA, SKEWNESS, STANDARD_DEVIATION, SUM, TE_TR, VALID_COUNT, VAR_COEFF, and VARIANCE.
Referenced by te::vp::AggregationMemory::buildOutDataSetType().
std::vector< std::string > te::stat::GetStringData | ( | te::da::DataSet * | dataSet, |
const std::string | propName | ||
) |
Returns the values of a string type property in a vector of values.
It returns only the non-empty values.
dataSet | A pointer to the dataset. Do not pass null. |
propName | The propoerty name. Do not pass empty. |
Definition at line 151 of file Utils.cpp.
References te::da::DataSet::getString(), te::da::DataSet::isNull(), te::da::DataSet::moveFirst(), and te::da::DataSet::moveNext().
Referenced by GetStringStatisticalSummaryQuery(), and te::stat::StatisticsDialog::setStatistics().
void te::stat::GetStringStatisticalSummary | ( | std::vector< std::string > & | values, |
te::stat::StringStatisticalSummary & | ss | ||
) |
Fills the summary statistics structure from a set of categorical values.
values | a vector of categorical values. Do not pass empty. |
ss | to return the statistical summary. |
Definition at line 69 of file SummaryFunctions.cpp.
References te::stat::StringStatisticalSummary::m_count, te::stat::StringStatisticalSummary::m_maxVal, te::stat::StringStatisticalSummary::m_minVal, te::stat::StringStatisticalSummary::m_mode, te::stat::StringStatisticalSummary::m_validCount, and Mode().
Referenced by buildStringFrequencies(), te::vp::AggregationMemory::calculateStringStats(), te::attributefill::VectorToVectorMemory::getClassWithHighestOccurrence(), GetStringStatisticalSummary(), GetStringStatisticalSummaryQuery(), te::attributefill::VectorToVectorMemory::run(), and te::stat::StatisticsDialog::setStatistics().
void te::stat::GetStringStatisticalSummary | ( | std::vector< std::string > & | values, |
te::stat::StringStatisticalSummary & | ss, | ||
const std::string & | nullValue | ||
) |
Fills the summary statistics structure from a set of categorical values.
values | a vector of categorical values. Do not pass empty. |
ss | to return the statistical summary. |
nullVal | a value to be considered as non-value or invalid value. |
Definition at line 53 of file SummaryFunctions.cpp.
References GetStringStatisticalSummary(), te::stat::StringStatisticalSummary::m_count, and te::stat::StringStatisticalSummary::m_validCount.
void te::stat::GetStringStatisticalSummaryQuery | ( | const std::string & | inDataset, |
te::da::DataSource * | inDatasource, | ||
const std::string & | propName, | ||
te::stat::StringStatisticalSummary & | ss | ||
) |
Fills the summary statistics structure of a given categorical property from a dataset.
inDataset | a dataset name. |
inDatasource | a pointer to a datasource. Do not pass null. |
propName | the name of the property to be summarized. |
ss | to return the statistical summary. |
Definition at line 330 of file SummaryFunctions.cpp.
References te::da::DataSource::dataSetExists(), te::da::DataSource::getCapabilities(), te::da::DataSource::getDataSet(), te::da::PropertyName::getName(), GetStringData(), GetStringStatisticalSummary(), te::stat::StringStatisticalSummary::m_count, te::stat::StringStatisticalSummary::m_maxVal, te::stat::StringStatisticalSummary::m_minVal, te::stat::StringStatisticalSummary::m_validCount, te::da::DataSource::query(), and te::da::DataSourceCapabilities::supportsPreparedQueryAPI().
std::vector< double > te::stat::Mode | ( | const std::vector< double > & | values | ) |
Returns the mode of set of numerical values.
values | a reference to a set of numerical values. Do not pass empty. |
Definition at line 216 of file SummaryFunctions.cpp.
Referenced by GetNumericStatisticalSummary(), GetStringStatisticalSummary(), and te::rp::Filter::ModeFilter().
std::string te::stat::Mode | ( | const std::vector< std::string > & | values | ) |
Returns the mode of set of categorical values.
values | a reference to a set of categorical values; |
Definition at line 277 of file SummaryFunctions.cpp.