te::stat Namespace Reference

This is the namespace for the Statistics module. More...

Classes

struct  NumericStatisticalComplexSummary
 
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

bool DoubleComplexCompare (std::complex< double > x, std::complex< double > y)
 
TESTATEXPORT void GetNumericComplexStatisticalSummary (std::vector< std::complex< double > > &values, te::stat::NumericStatisticalComplexSummary &ss)
 
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 nullValue)
 
TESTATEXPORT void GetNumericStatisticalSummary (std::vector< double > &values, te::stat::NumericStatisticalSummary &ss)
 
TESTATEXPORT void GetNumericStatisticalSummary (std::map< double, int > &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::map< double, int > &values, double &resolutionX, double &resolutionY, double &area, te::stat::NumericStatisticalSummary &ss)
 
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, const std::string &nullValue)
 
TESTATEXPORT void GetStringStatisticalSummary (std::vector< std::string > &values, te::stat::StringStatisticalSummary &ss)
 
TESTATEXPORT void GetStringStatisticalSummaryQuery (const std::string &inDataset, te::da::DataSource *inDatasource, const std::string &propName, te::stat::StringStatisticalSummary &ss)
 
TESTATEXPORT void Mode (const std::vector< double > &values, te::stat::NumericStatisticalSummary &ss)
 
TESTATEXPORT void Mode (const std::vector< std::string > &values, te::stat::StringStatisticalSummary &ss)
 

Detailed Description

This is the namespace for the Statistics module.

Enumeration Type Documentation

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. };

Enumerator
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.

PERCENT_EACH_CLASS_BY_AREA 

Percente of each class by area.

PERCENT_TOTAL_AREA 

Percente of total area.

Definition at line 39 of file src/terralib/statistics/core/Enums.h.

Function Documentation

bool te::stat::DoubleComplexCompare ( std::complex< double >  x,
std::complex< double >  y 
)

Definition at line 57 of file SummaryFunctions.cpp.

Referenced by GetNumericComplexStatisticalSummary().

std::vector< double > te::stat::GetNumericData ( te::da::DataSet dataSet,
const std::string  propName 
)
void te::stat::GetNumericStatisticalSummary ( std::vector< double > &  values,
te::stat::NumericStatisticalSummary ss,
double  nullValue 
)
void te::stat::GetNumericStatisticalSummaryQuery ( const std::string &  inDataset,
te::da::DataSource inDatasource,
const std::string &  propName,
te::stat::NumericStatisticalSummary ss 
)
void te::stat::GetPercentOfEachClassByArea ( std::map< double, int > &  values,
double &  resolutionX,
double &  resolutionY,
double &  area,
te::stat::NumericStatisticalSummary ss 
)

Fills the percentage of each class by area.

Parameters
valuesa map of numerical values as key and number of occurrence as value. Do not pass empty.
resolutionXa raster horizontal (x-axis) resolution.
resolutionYa raster vertical (y-axis) resolution.
areaarea of a geometry that intersects the raster.
ssto return the percentage of each class by area.

Definition at line 353 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.

Parameters
eThe enumerator.
Returns
The statistical parameter full name of enum.

Definition at line 94 of file src/terralib/statistics/core/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::DissolveDialog::setStatisticalSummary(), te::vp::DissolveDialog::setStatisticalSummaryMap(), te::stat::StatisticsDialog::setStatistics(), and updateSummary().

std::string te::stat::GetStatSummaryShortName ( const int e)

Get the statistical parameter short name from its enumerator.

Parameters
eThe enumerator.
Returns
The short name for the statistical parameter.

Definition at line 37 of file src/terralib/statistics/core/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::GetOutputDataSetType().

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.

Parameters
dataSetA pointer to the dataset. Do not pass null.
propNameThe propoerty name. Do not pass empty.
Returns
The vector of string values.

Definition at line 151 of file src/terralib/statistics/core/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,
const std::string &  nullValue 
)

Fills the summary statistics structure from a set of categorical values.

Parameters
valuesa vector of categorical values. Do not pass empty.
ssto return the statistical summary.
nullVala value to be considered as non-value or invalid value.

Definition at line 65 of file SummaryFunctions.cpp.

References te::stat::StringStatisticalSummary::m_count, and te::stat::StringStatisticalSummary::m_validCount.

Referenced by buildStringFrequencies(), te::attributefill::VectorToVectorMemory::getClassWithHighestOccurrence(), GetStringStatisticalSummaryQuery(), te::vp::PopulateItems(), te::attributefill::VectorToVectorMemory::run(), 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.

Parameters
valuesa vector of categorical values. Do not pass empty.
ssto return the statistical summary.

Definition at line 81 of file SummaryFunctions.cpp.

References te::stat::StringStatisticalSummary::m_count, te::stat::StringStatisticalSummary::m_maxVal, te::stat::StringStatisticalSummary::m_minVal, 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.

Parameters
inDataseta dataset name.
inDatasourcea pointer to a datasource. Do not pass null.
propNamethe name of the property to be summarized.
ssto return the statistical summary.

Definition at line 497 of file SummaryFunctions.cpp.

References te::da::DataSource::dataSetExists(), ds, 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::mnt::Max(), te::mnt::Min(), te::da::DataSource::query(), and te::da::DataSourceCapabilities::supportsPreparedQueryAPI().

void te::stat::Mode ( const std::vector< double > &  values,
te::stat::NumericStatisticalSummary ss 
)

Returns the mode of set of numerical values.

Parameters
valuesa reference to a set of numerical values. Do not pass empty.
ssto return the mode (most frequent value).

Definition at line 381 of file SummaryFunctions.cpp.

References te::stat::NumericStatisticalSummary::m_mode.

Referenced by te::attributefill::VectorToVectorMemory::getClassWithHighestOccurrence(), te::rp::RasterAttributes::getStatistics(), te::attributefill::VectorToVectorMemory::run(), and te::stat::StatisticsDialog::setStatistics().

void te::stat::Mode ( const std::vector< std::string > &  values,
te::stat::StringStatisticalSummary ss 
)

Returns the mode of set of categorical values.

Parameters
valuesa reference to a set of categorical values;
ssto return the mode (most frequent value).

Definition at line 443 of file SummaryFunctions.cpp.

References te::stat::StringStatisticalSummary::m_mode.