24 #include "../core/logger/Logger.h" 25 #include "../common/progress/TaskProgress.h" 26 #include "../common/StringUtils.h" 27 #include "../common/STLUtils.h" 28 #include "../core/translator/Translator.h" 30 #include "../dataaccess/dataset/DataSet.h" 31 #include "../dataaccess/dataset/DataSetAdapter.h" 32 #include "../dataaccess/dataset/DataSetType.h" 33 #include "../dataaccess/dataset/DataSetTypeConverter.h" 34 #include "../dataaccess/dataset/ObjectIdSet.h" 35 #include "../dataaccess/datasource/DataSource.h" 36 #include "../dataaccess/datasource/DataSourceInfo.h" 37 #include "../dataaccess/datasource/DataSourceInfoManager.h" 38 #include "../dataaccess/datasource/DataSourceCapabilities.h" 39 #include "../dataaccess/datasource/DataSourceTransactor.h" 41 #include "../dataaccess/query/Avg.h" 42 #include "../dataaccess/query/Cast.h" 43 #include "../dataaccess/query/Count.h" 44 #include "../dataaccess/query/Field.h" 45 #include "../dataaccess/query/Fields.h" 46 #include "../dataaccess/query/GroupBy.h" 47 #include "../dataaccess/query/GroupByItem.h" 48 #include "../dataaccess/query/Insert.h" 49 #include "../dataaccess/query/LiteralInt32.h" 50 #include "../dataaccess/query/Max.h" 51 #include "../dataaccess/query/Min.h" 52 #include "../dataaccess/query/PropertyName.h" 53 #include "../dataaccess/query/Select.h" 54 #include "../dataaccess/query/Sub.h" 55 #include "../dataaccess/query/SubSelect.h" 56 #include "../dataaccess/query/Sum.h" 57 #include "../dataaccess/query/ST_Dump.h" 58 #include "../dataaccess/query/ST_Multi.h" 59 #include "../dataaccess/query/ST_Union.h" 60 #include "../dataaccess/query/StdDev.h" 61 #include "../dataaccess/query/Variance.h" 63 #include "../dataaccess/utils/Utils.h" 65 #include "../datatype/Property.h" 66 #include "../datatype/SimpleData.h" 67 #include "../datatype/StringProperty.h" 69 #include "../geometry/Geometry.h" 70 #include "../geometry/GeometryCollection.h" 71 #include "../geometry/GeometryProperty.h" 72 #include "../geometry/MultiLineString.h" 73 #include "../geometry/MultiPoint.h" 74 #include "../geometry/MultiPolygon.h" 75 #include "../geometry/Utils.h" 77 #include "../memory/DataSet.h" 78 #include "../memory/DataSetItem.h" 80 #include "../statistics/core/Utils.h" 89 #include <boost/algorithm/string.hpp> 90 #include <boost/thread.hpp> 98 const std::map<std::string, te::dt::AbstractData*>& specificParams)
100 std::vector<std::string> propNames;
102 if (specificParams.empty())
105 std::map<std::string, te::dt::AbstractData*>::const_iterator it = specificParams.begin();
107 while (it != specificParams.end())
109 if (it->first !=
"DISSOLVE")
127 std::map<te::dt::Property*, std::vector<te::stat::StatisticalSummary> >
129 const std::map<std::string, te::dt::AbstractData*>& specificParams)
131 std::map<te::dt::Property*, std::vector<te::stat::StatisticalSummary> > statisticalSummaryMap;
133 if (specificParams.empty())
134 return statisticalSummaryMap;
136 std::map<std::string, te::dt::AbstractData*>::const_iterator it = specificParams.begin();
139 while (it != specificParams.end())
141 if (it->first !=
"SUMMARY")
150 te::dt::Property*, std::vector<te::stat::StatisticalSummary>
> >*>(
154 statisticalSummaryMap = cd->
getValue();
159 return statisticalSummaryMap;
164 bool isCollection =
false;
166 std::map<std::string, te::dt::AbstractData*>::const_iterator it = specificParams.begin();
167 while (it != specificParams.end())
169 if (it->first !=
"IS_COLLECTION")
190 std::vector<te::vp::InputParams> inputParams = mainParams->
getInputParams();
202 outputDataSetType->
add(pkProperty);
212 if (inputParams[0].m_inputDataSetType)
214 dsType = inputParams[0].m_inputDataSetType;
218 dsType =
te::da::GetDataSetType(inputParams[0].m_inputDataSetName, inputParams[0].m_inputDataSource->getId());
223 const std::map<std::string, te::dt::AbstractData*>& specificParams = mainParams->
getSpecificParams();
226 for (std::size_t i = 0; i < propNames.size(); ++i)
234 outputDataSetType->
add(prop);
245 outputDataSetType->
add(numDissolvedProperty);
249 std::map<te::dt::Property*, std::vector<te::stat::StatisticalSummary> > summaryAtt =
GetSummaryProps(specificParams);
250 std::map<te::dt::Property*, std::vector<te::stat::StatisticalSummary> >::const_iterator itSummaryAtt = summaryAtt.begin();
252 while (itSummaryAtt != summaryAtt.end())
254 std::vector<te::stat::StatisticalSummary> vectorResult = itSummaryAtt->second;
256 int p_type = itSummaryAtt->first->getType();
258 for (std::size_t s = 0; s < vectorResult.size(); ++s)
260 std::string attName = itSummaryAtt->first->getName();
267 outputDataSetType->
add(funcProp);
273 outputDataSetType->
add(funcProp);
290 outputDataSetType->
add(newGeomProp);
292 return outputDataSetType;
317 std::vector<te::gm::Geometry*> extractGeometryVec;
322 std::unique_ptr<te::gm::Geometry> outputGeometry =
nullptr;
325 outputGeometry.reset(dynamic_cast<te::gm::Geometry*>(inputGeometry.
clone()));
329 if (outputGeometry->getGeomTypeId() == outputGeomType)
330 extractGeometryVec.push_back(outputGeometry.release());
340 std::vector<te::gm::Geometry*>filteredGeometryVec;
342 for (std::size_t i = 0; i < extractGeometryVec.size(); ++i)
344 if (extractGeometryVec[i]->getGeomTypeId() == outputGeomType)
346 filteredGeometryVec.push_back(extractGeometryVec[i]);
350 delete extractGeometryVec[i];
354 extractGeometryVec = filteredGeometryVec;
360 extractGeometryVec.push_back(dynamic_cast<te::gm::Geometry*>(inputGeometry.
clone()));
365 return extractGeometryVec;
370 const std::vector<te::mem::DataSetItem*> inputItens,
371 const std::map<std::string, te::dt::AbstractData*> specificParams,
372 std::vector<te::mem::DataSetItem*>& outputItemVec)
375 std::vector<std::string> dissolvePropNames =
GetDissolveProps(specificParams);
377 for (std::size_t i = 0; i < dissolvePropNames.size(); ++i)
385 std::string propName = prop->
getName();
387 if (!inputItens[0]->isNull(prop_position))
389 for (std::size_t j = 0; j < outputItemVec.size(); ++j)
390 outputItemVec[j]->
setValue(propName, inputItens[0]->getValue(prop_position)->clone());
400 for (std::size_t n = 0; n < outputItemVec.size(); ++n)
401 outputItemVec[n]->setInt32(
"NUM_OBJ", (
int)inputDataSetType->
size());
405 std::map<te::dt::Property*, std::vector<te::stat::StatisticalSummary> > summaryProps =
GetSummaryProps(specificParams);
406 std::map<te::dt::Property*, std::vector<te::stat::StatisticalSummary> >::iterator summaryPropsIt = summaryProps.begin();
408 while (summaryPropsIt != summaryProps.end())
412 std::string propertyName = currentProp->
getName();
416 std::size_t numberOutputProps = outputItemVec[0]->getNumProperties();
420 std::vector<std::string> inputValueStatSummary;
422 for (std::size_t i = 0; i < inputItens.size(); ++i)
424 if (inputItens[i]->isNull(currentPropPosition))
427 std::string valueString = inputItens[i]->getString(currentPropPosition);
428 inputValueStatSummary.push_back(valueString);
434 for (std::size_t
p = 0;
p < numberOutputProps; ++
p)
436 if (outputItemVec[0]->getPropertyName(
p) == propertyName +
"_MIN_VALUE")
437 outputItemVec[0]->setString(propertyName +
"_MIN_VALUE", ss.
m_minVal);
439 if (outputItemVec[0]->getPropertyName(
p) == propertyName +
"_MAX_VALUE")
440 outputItemVec[0]->setString(propertyName +
"_MAX_VALUE", ss.
m_maxVal);
442 if (outputItemVec[0]->getPropertyName(
p) == propertyName +
"_COUNT")
443 outputItemVec[0]->setString(propertyName +
"_COUNT", boost::lexical_cast<std::string>(ss.
m_count));
445 if (outputItemVec[0]->getPropertyName(
p) == propertyName +
"_VALID_COUNT")
446 outputItemVec[0]->setString(propertyName +
"_VALID_COUNT", boost::lexical_cast<std::string>(ss.
m_validCount));
451 std::vector<double> inputValueStatSummary;
453 for (std::size_t i = 0; i < inputItens.size(); ++i)
455 if (inputItens[i]->isNull(currentPropPosition))
460 switch (currentProp->
getType())
463 valueDouble = inputItens[i]->getInt16(currentPropPosition);
466 valueDouble = inputItens[i]->getInt32(currentPropPosition);
469 valueDouble = (double)inputItens[i]->getInt64(currentPropPosition);
472 valueDouble = inputItens[i]->getFloat(currentPropPosition);
475 valueDouble = inputItens[i]->getDouble(currentPropPosition);
482 inputValueStatSummary.push_back(valueDouble);
488 for (std::size_t
p = 0;
p < numberOutputProps; ++
p)
490 if (outputItemVec[0]->getPropertyName(
p) == propertyName +
"_MIN_VALUE")
491 outputItemVec[0]->setDouble(propertyName +
"_MIN_VALUE", ss.
m_minVal);
493 if (outputItemVec[0]->getPropertyName(
p) == propertyName +
"_MAX_VALUE")
494 outputItemVec[0]->setDouble(propertyName +
"_MAX_VALUE", ss.
m_maxVal);
496 if (outputItemVec[0]->getPropertyName(
p) == propertyName +
"_COUNT")
497 outputItemVec[0]->setDouble(propertyName +
"_COUNT", ss.
m_count);
499 if (outputItemVec[0]->getPropertyName(
p) == propertyName +
"_VALID_COUNT")
500 outputItemVec[0]->setDouble(propertyName +
"_VALID_COUNT", ss.
m_validCount);
502 if (outputItemVec[0]->getPropertyName(
p) == propertyName +
"_MEAN")
503 outputItemVec[0]->setDouble(propertyName +
"_MEAN", ss.
m_mean);
505 if (outputItemVec[0]->getPropertyName(
p) == propertyName +
"_SUM")
506 outputItemVec[0]->setDouble(propertyName +
"_SUM", ss.
m_sum);
508 if (outputItemVec[0]->getPropertyName(
p) == propertyName +
"_STANDARD_DEVIATION")
509 outputItemVec[0]->setDouble(propertyName +
"_STANDARD_DEVIATION", ss.
m_stdDeviation);
511 if (outputItemVec[0]->getPropertyName(
p) == propertyName +
"_VARIANCE")
512 outputItemVec[0]->setDouble(propertyName +
"_VARIANCE", ss.
m_variance);
514 if (outputItemVec[0]->getPropertyName(
p) == propertyName +
"_SKEWNESS")
515 outputItemVec[0]->setDouble(propertyName +
"_SKEWNESS", ss.
m_skewness);
517 if (outputItemVec[0]->getPropertyName(
p) == propertyName +
"_KURTOSIS")
518 outputItemVec[0]->setDouble(propertyName +
"_KURTOSIS", ss.
m_kurtosis);
520 if (outputItemVec[0]->getPropertyName(
p) == propertyName +
"_AMPLITUDE")
521 outputItemVec[0]->setDouble(propertyName +
"_AMPLITUDE", ss.
m_amplitude);
523 if (outputItemVec[0]->getPropertyName(
p) == propertyName +
"_MEDIAN")
524 outputItemVec[0]->setDouble(propertyName +
"_MEDIAN", ss.
m_median);
526 if (outputItemVec[0]->getPropertyName(
p) == propertyName +
"_VAR_COEFF")
527 outputItemVec[0]->setDouble(propertyName +
"_VAR_COEFF", ss.
m_varCoeff);
529 if (outputItemVec[0]->getPropertyName(
p) == propertyName +
"_MODE")
531 std::string modeValues;
535 modeValues = boost::lexical_cast<std::string>(ss.
m_mode[0]);
536 for (std::size_t i = 1; i < ss.
m_mode.size(); ++i)
539 modeValues += boost::lexical_cast<std::string>(ss.
m_mode[i]);
543 outputItemVec[0]->setString(propertyName +
"_MODE", modeValues);
559 std::vector<te::vp::InputParams> inputParams = mainParams->
getInputParams();
562 if (!inputParams[0].m_inputDataSetType)
565 std::unique_ptr<te::da::DataSetType> dsType_input(inputParams[0].m_inputDataSetType);
569 if (!inputParams[0].m_inputDataSet)
572 std::unique_ptr<te::da::DataSet>inputDataSet(inputParams[0].m_inputDataSet);
585 std::unique_ptr<te::mem::DataSet> outputDataSet(
new te::mem::DataSet(outputDataSetType.get()));
588 std::map<std::string, te::dt::AbstractData*> specificParams = mainParams->
getSpecificParams();
592 if (dissolveProps.empty())
596 std::vector<size_t> groupPropIdxs;
598 for (std::size_t i = 0; i < dissolveProps.size(); ++i)
600 std::size_t position = dsType_input->getPropertyPosition(dissolveProps[i]);
601 if (position < dsType_input->size())
602 groupPropIdxs.push_back(position);
606 std::map<std::string, std::vector<int> > groups;
607 std::map<std::string, std::vector<int> >::iterator it_groups;
610 inputDataSet->moveBeforeFirst();
612 while (inputDataSet->move(dataSetPos))
616 for (std::size_t i = 0; i < groupPropIdxs.size(); ++i)
618 if (inputDataSet->isNull(groupPropIdxs[i]))
620 std::string message =
TE_TR(
"The selected attribute to aggregate has null values.");
630 key += inputDataSet->getAsString(groupPropIdxs[i]);
634 it_groups = groups.find(key);
635 if (it_groups == groups.end())
637 std::vector<int> dataSetPosVector;
638 dataSetPosVector.push_back(dataSetPos);
639 groups.insert(std::pair<std::string, std::vector<int> >(key, dataSetPosVector));
643 it_groups->second.push_back(dataSetPos);
655 , outputDataSet.get()
656 , outputDataSetType.get()
657 , outputDataSource.get()
660 boost::thread_group threadGroup;
661 threadGroup.add_thread(
new boost::thread(
threadSave, manager));
663 std::size_t numProcs = 8;
664 for (std::size_t i = 0; i < numProcs; ++i)
666 threadGroup.add_thread(
new boost::thread(
threadUnion, manager));
669 threadGroup.join_all();
672 std::vector<std::string> threadWarnings = manager->
getWarnings();
673 for (std::size_t w = 0; w < threadWarnings.size(); ++w)
681 TE_TR(
"Finalized."));
689 std::vector<te::vp::InputParams> inputParams = mainParams->
getInputParams();
693 if (!inputParams[0].m_inputDataSetType)
696 std::unique_ptr<te::da::DataSetType> dsType_input(inputParams[0].m_inputDataSetType);
700 std::string aliasInput = dsType_input->
getName();
704 if (!inputParams[0].m_inputQuery)
709 aliasInput = subSelectInput->
getAlias();
716 const std::map<std::string, te::dt::AbstractData*>& specificParams = mainParams->
getSpecificParams();
719 std::vector<std::string> dissolveAttributes =
GetDissolveProps(specificParams);
721 if (dissolveAttributes.size() < 1)
724 for (std::size_t
d = 0;
d < dissolveAttributes.size(); ++
d)
727 fields.push_back(f_dissolveAtt);
733 std::map<te::dt::Property*, std::vector<te::stat::StatisticalSummary> > summaryAttributes;
743 fields.push_back(f_aggCount);
748 std::map<te::dt::Property*, std::vector<te::stat::StatisticalSummary> >::const_iterator itSummaryAtt = summaryAttributes.begin();
750 while (itSummaryAtt != summaryAttributes.end())
752 std::vector<te::stat::StatisticalSummary>::const_iterator itFunc = itSummaryAtt->second.begin();
753 while (itFunc != itSummaryAtt->second.end())
838 fields.push_back(s_field);
855 fields.push_back(f_union);
862 TE_TR(
"A problem was found. SubSelect Input with problem."));
868 fromDissolve.push_back(subSelectInput);
875 for (std::size_t i = 0; i < dissolveAttributes.size(); ++i)
878 groupBy->push_back(e_groupBy);
891 std::unique_ptr<te::da::DataSourceTransactor> t = outputDataSource->getTransactor();
892 std::map<std::string, std::string> options;
897 if (outputDataSource->getType() ==
"OGR")
899 outputDataSource->createDataSet(outputDataSetType.get(), options);
904 t->createDataSet(outputDataSetType.get(), options);
907 if (!inDataSourceInfoPtr)
910 TE_TR(
"Input DataSource ID not found."));
916 if (!outDataSourceInfoPtr)
919 TE_TR(
"Output DataSource ID not found."));
926 std::string inputConnection = inDataSourceInfoPtr->getConnInfoAsString();
928 std::string outputConnection;
929 if(outDataSourceInfoPtr.get())
930 outputConnection = outDataSourceInfoPtr->getConnInfoAsString();
934 if (inputConnection == outputConnection)
939 for (std::size_t
p = 0;
p < dissolveAttributes.size(); ++
p)
942 insertFields.push_back(f_att);
948 insertFields.push_back(f_numObj);
951 std::map<te::dt::Property*, std::vector<te::stat::StatisticalSummary> >::const_iterator itInsert = summaryAttributes.begin();
953 while (itInsert != summaryAttributes.end())
955 std::vector<te::stat::StatisticalSummary>::const_iterator itFunc = itInsert->second.begin();
956 while (itFunc != itInsert->second.end())
1004 insertFields.push_back(s_field);
1013 insertFields.push_back(f_insert);
1016 outputDataSource->execute(*insert);
1020 std::unique_ptr<te::da::DataSet> dsQuery = inputParams[0].m_inputDataSource->query(select);
1021 dsQuery->moveBeforeFirst();
1023 if (dsQuery->size() == 0)
1026 TE_TR(
"The resultant layer is empty!"));
1033 if (outputDataSource->getType() ==
"OGR")
1035 outputDataSource->add(outputDsName, dsQuery.get(), options);
1039 t->add(outputDsName, dsQuery.get(), options);
1055 std::vector<te::mem::DataSetItem*> dsItemVec;
1063 std::size_t outputGeomPos =
1067 std::map<std::string, te::dt::AbstractData*> specificParams =
1072 std::vector<te::mem::DataSetItem*> outputItemVec;
1074 std::vector<te::gm::Geometry*> geomVec;
1075 for (std::size_t i = 0; i < dsItemVec.size(); ++i)
1077 std::unique_ptr<te::gm::Geometry> geom = dsItemVec[i]->getGeometry(geomPos);
1079 geomVec.push_back(geom.release());
1086 std::unique_ptr<te::gm::Geometry> unionGeometry;
1093 if(unionGeometry ==
nullptr)
1095 std::string message =
TE_TR(
"Vector Processing") + std::string(
" - ") +
1096 TE_TR(
"Dissolve") + std::string(
": ") +
1097 TE_TR(
"The result of a to dissolved group returned an empty geometry. Check the log file.");
1110 std::string message =
TE_TR(
"Vector Processing") + std::string(
" - ") +
1111 TE_TR(
"Dissolve") + std::string(
": ") +
1112 TE_TR(
"GEOS Exception") + std::string(
": ");
1113 message += e.
what();
1127 std::string message =
TE_TR(
"Vector Processing") + std::string(
" - ") +
1128 TE_TR(
"Dissolve") + std::string(
": ") +
1129 TE_TR(
"Unknown Excption.");
1141 std::vector<te::gm::Geometry*> geometryResultVec =
1145 for (std::size_t g = 0; g < geometryResultVec.size(); ++g)
1149 item->
setGeometry(outputGeomPos, geometryResultVec[g]);
1151 outputItemVec.push_back(item);
1154 PopulateItems(dataSetType, dsItemVec, specificParams, outputItemVec);
1167 std::vector<te::mem::DataSetItem*> outputItemVec;
1171 if (outputItemVec.empty())
1173 boost::this_thread::sleep(boost::posix_time::milliseconds(1000));
1181 for (std::size_t i = 0; i < outputItemVec.size(); ++i)
1183 outputDataSet->
add(outputItemVec[i]);
1189 if (!dataSetPrepared)
1191 manager->
addWarning(
"Output DataSet was not prepared to save.");
1194 TE_TR(
"Output DataSet was not prepared to save."));
1197 if (dataSetPrepared->
isEmpty())
1199 manager->
addWarning(
"The resultant layer is empty!");
1202 TE_TR(
"The resultant layer is empty!"));
1205 Save(outputDataSource, dataSetPrepared, outputDataType,
false);
1206 outputItemVec.clear();
void setAutoNumber(bool a)
It tells if the property is an autonumber or not.
Property * getProperty(std::size_t i) const
It returns the i-th property.
te::da::DataSetType * getDataSetType()
const std::string & getName() const
It returns the property name.
boost::ptr_vector< GroupByItem > GroupBy
A class that can be used to model a GROUP BY clause.
A structure to hold the set of statistics from a set of numerical values.
TEVPEXPORT std::unique_ptr< te::da::DataSet > PrepareAdd(te::da::DataSet *ds, te::da::DataSetType *dt)
void addOutput(std::vector< te::mem::DataSetItem * > &itemGroup)
te::da::DataSetType * GetOutputDataSetType(te::vp::AlgorithmParams *mainParams)
void add(te::dt::Property *p)
It adds a property to the list of properties of the primary key.
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
void setGeometry(std::size_t i, te::gm::Geometry *value)
It sets the value of the i-th property.
te::mem::DataSetItem * createOutputItem()
A class that can be used in a GROUP BY clause.
The Field class can be used to model an expression that takes part of the output items of a SELECT...
void setSRID(int srid)
It sets the spatial reference system identifier associated to this property.
void setGeometryType(GeomType t)
It sets the geometry subtype.
An atomic property like an integer or double.
A class that models the name of a dataset used in a From clause.
boost::shared_ptr< DataSource > DataSourcePtr
A class that models the name of any property of an object.
A class that models the description of a dataset.
TEGEOMEXPORT te::gm::GeomType GetMultiType(te::gm::GeomType geomType)
Get the collection type of GeomType.
virtual const char * what() const
It outputs the exception message.
TEMNTEXPORT te::gm::Point Max(te::gm::Point &p1, te::gm::Point &p2)
std::vector< std::string > GetDissolveProps(const std::map< std::string, te::dt::AbstractData * > &specificParams)
GeomType getGeomTypeId() const _NOEXCEPT_OP(true)
It returns the geometry subclass type identifier.
bool executeQuery(te::vp::AlgorithmParams *mainParams)
TESTATEXPORT std::string GetStatSummaryShortName(const int &e)
Get the statistical parameter short name from its enumerator.
Count statistical function.
std::vector< double > m_mode
TEGEOMEXPORT bool IsMultiType(te::gm::GeomType geomType)
Verifies if the geomType is a collection type.
std::vector< te::vp::InputParams > getInputParams()
T getValue() const
It returns the associated value.
TEGEOMEXPORT std::unique_ptr< te::gm::Geometry > GetGeometryUnion(const std::vector< te::gm::Geometry * > &geomVec)
It returns the union of a geometry vector.
TEGEOMEXPORT te::gm::GeomType GetSimpleType(te::gm::GeomType geomType)
Get the simple type of GeomType.
An abstract class for data providers like a DBMS, Web Services or a regular file. ...
bool getNextOutput(std::vector< te::mem::DataSetItem * > &nextOutput)
#define TE_TR(message)
It marks a string in order to get translated.
virtual Property * clone() const =0
It returns a clone of the object.
#define TE_LOG_INFO(message)
Use this tag in order to log a message to the TerraLib default logger with the INFO level...
The Insert object can add the return of a select object.
TEGEOMEXPORT void Multi2Single(const te::gm::Geometry *g, std::vector< te::gm::Geometry * > &geoms)
It will get a GeometryCollection and distribute in a vector.
Class to manager group values in threads.
It models a property definition.
Avg statistical function.
te::gm::GeomType SetGeomResultType(const te::gm::GeomType &geomType, const bool &isCollection)
static void threadSave(GroupThreadManager *manager)
T getValue() const
It returns the associated value.
This is an abstract class that models a query expression.
void add(DataSetItem *item)
It adds a new item to the dataset and takes its ownership.
StdDev statistical function.
static void threadUnion(GroupThreadManager *manager)
TEVPEXPORT void Save(te::da::DataSource *source, te::da::DataSet *result, te::da::DataSetType *outDsType, const bool &enableProgress=true)
Implementation of a random-access dataset class for the TerraLib In-Memory Data Access driver...
virtual bool isEmpty() const =0
It returns true if the collection is empty.
TESAEXPORT double Sum(te::sa::GeneralizedProximityMatrix *gpm, int attrIdx)
Function used to calculate sum of a specific attribute from a gpm.
A template for complex data types.
void PopulateItems(const te::da::DataSetType *inputDataSetType, const std::vector< te::mem::DataSetItem * > inputItens, const std::map< std::string, te::dt::AbstractData * > specificParams, std::vector< te::mem::DataSetItem * > &outputItemVec)
static DataSourceInfoManager & getInstance()
It returns a reference to the singleton instance.
const std::string & getOutputDataSetName()
bool executeMemory(te::vp::AlgorithmParams *mainParams)
const std::string & getAlias() const
It returns the alias associated to the source item.
mydialect insert("+", new te::da::BinaryOpEncoder("+"))
static te::dt::DateTime d(2010, 8, 9, 15, 58, 39)
GeomType getGeometryType() const
It returns the geometry subtype allowed for the property.
boost::ptr_vector< Field > Fields
Fields is just a boost::ptr_vector of Field pointers.
TESTATEXPORT void GetNumericStatisticalSummary(std::vector< double > &values, te::stat::NumericStatisticalSummary &ss, double nullValue)
virtual AbstractData * clone() const =0
It returns a clone of this object.
te::da::DataSourcePtr getOutputDataSource()
The type for string types: FIXED_STRING, VAR_STRING or STRING.
const std::map< std::string, te::dt::AbstractData * > & getSpecificParams()
std::size_t size() const
It returns the number of properties of the CompositeProperty.
line< nLines;++line) for(col=0;col< nCols;++col){rasterPointer-> setValue(col, line, pixelValue, band)
Utility functions for the data access module.
const int & getOutputSRID()
void setGroupBy(GroupBy *g)
It sets the list of expressions used to condense the result set.
ST_Dump statistical function.
This class is designed to declare objects to be thrown as exceptions by TerraLib. ...
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
A Select models a query to be used when retrieving data from a DataSource.
boost::ptr_vector< FromItem > From
It models the FROM clause for a query.
std::map< te::dt::Property *, std::vector< te::stat::StatisticalSummary > > GetSummaryProps(const std::map< std::string, te::dt::AbstractData * > &specificParams)
int getType() const
It returns the property data type.
void add(Constraint *c)
It adds a new constraint.
std::vector< std::string > getWarnings()
TESTATEXPORT void GetStringStatisticalSummary(std::vector< std::string > &values, te::stat::StringStatisticalSummary &ss, const std::string &nullValue)
An implementation of the DatasetItem class for the TerraLib In-Memory Data Access driver...
A dataset is the unit of information manipulated by the data access module of TerraLib.
void addWarning(const std::string &warning, const bool &appendIfExist=false)
te::da::DataSetType * getOutputDataSetType()
The subtraction operator.
A structure to hold the set of statistics from a set of categorical (sample) values.
It describes a primary key (pk) constraint.
Variance statistical function.
bool getNextGroup(std::vector< te::mem::DataSetItem * > &nextGroup)
Cast a expression function.
#define TE_LOG_ERROR(message)
Use this tag in order to log a message to the TerraLib default logger with the ERROR level...
std::size_t getPropertyPosition(const std::string &name) const
It returns the property position based on its name.
ST_Union statistical function.
TEDATAACCESSEXPORT DataSetType * GetDataSetType(const std::string &name, const std::string &datasourceId)
TEMNTEXPORT te::gm::Point Min(te::gm::Point &p1, te::gm::Point &p2)
te::mem::DataSet * getClearOutputDataSet()
void addWarning(const std::string &warning, const bool &appendIfExists=false)
A template for atomic data types (integers, floats, strings and others).
A Select can be used as a source of information in another query.
std::vector< te::gm::Geometry * > ExtractGeometry(te::gm::Geometry &inputGeometry, const te::gm::GeomType &outputGeomType)
TEDATAACCESSEXPORT te::gm::GeometryProperty * GetFirstGeomProperty(const DataSetType *dt)
void FreeContents(boost::unordered_map< K, V * > &m)
This function can be applied to a map of pointers. It will delete each pointer in the map...
te::da::DataSource * getOutputDataSource()
TEVPEXPORT te::gm::Geometry * SetGeomAsMulti(const te::gm::Geometry &geom)
std::map< std::string, te::dt::AbstractData * > getSpecificParameters()
void setPrimaryKey(PrimaryKey *pk)
It sets the primary key constraint.
bool IsCollection(const std::map< std::string, te::dt::AbstractData * > &specificParams)
boost::shared_ptr< DataSourceInfo > DataSourceInfoPtr
const std::string & getName() const
It returns the property name.
void setParent(Property *p)
It associate this property to the informed parent.