AggregationOp.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file AggregationOp.h
22 
23  \brief Aggregation operation.
24 
25  \ingroup vp
26  */
27 
28 #ifndef __TERRALIB_VP_INTERNAL_AGGREGATION_OP_H
29 #define __TERRALIB_VP_INTERNAL_AGGREGATION_OP_H
30 
31 //Terralib
32 
33 #include "../dataaccess/dataset/DataSet.h"
34 #include "../dataaccess/dataset/DataSetTypeConverter.h"
35 #include "../dataaccess/dataset/ObjectIdSet.h"
36 #include "../dataaccess/datasource/DataSource.h"
37 
38 #include "../datatype/Property.h"
39 
40 #include "../memory/DataSet.h"
41 #include "../statistics/core/Enums.h"
42 
43 #include "Config.h"
44 #include "Enums.h"
45 
46 // STL
47 #include <map>
48 #include <memory>
49 #include <string>
50 #include <vector>
51 
52 namespace te
53 {
54  namespace vp
55  {
57  {
58  public:
59 
60  AggregationOp();
61 
62  virtual ~AggregationOp() {}
63 
64  virtual bool run() = 0;
65 
66  virtual bool paramsAreValid();
67 
68  void setInput(te::da::DataSourcePtr inDsrc,
69  std::string inDsetName,
70  std::auto_ptr<te::da::DataSetTypeConverter> converter,
71  const te::da::ObjectIdSet* oidSet = 0);
72 
73  void setParams(std::vector<te::dt::Property*>& groupProps,
74  std::map<te::dt::Property*, std::vector<te::stat::StatisticalSummary> >&statSum);
75 
76  void setOutput(te::da::DataSourcePtr outDsrc, std::string dsname);
77 
78  protected:
79 
80  // it defines the type of the result considering the input geometries being aggregated
81  te::gm::GeomType getGeomResultType(te::gm::GeomType geom);
82 
84  std::string m_inDsetName;
85  std::auto_ptr<te::da::DataSetTypeConverter> m_converter;
87 
88  std::vector<te::dt::Property*> m_groupProps;
89  std::map<te::dt::Property*, std::vector<te::stat::StatisticalSummary> > m_statSum;
90 
92  std::string m_outDset;
93  };
94  }
95 }
96 #endif // __TERRALIB_VP_INTERNAL_AGGREGATION_OP_H
te::da::DataSourcePtr m_inDsrc
Definition: AggregationOp.h:83
#define TEVPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:61
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
Definition: Enums.h:41
std::string m_inDsetName
Definition: AggregationOp.h:84
boost::shared_ptr< DataSource > DataSourcePtr
Definition: DataSource.h:1435
std::vector< te::dt::Property * > m_groupProps
Definition: AggregationOp.h:88
std::auto_ptr< te::da::DataSetTypeConverter > m_converter
Definition: AggregationOp.h:85
It models a property definition.
Definition: Property.h:59
te::da::DataSourcePtr m_outDsrc
Definition: AggregationOp.h:91
std::map< te::dt::Property *, std::vector< te::stat::StatisticalSummary > > m_statSum
Definition: AggregationOp.h:89
This class represents a set of unique ids created in the same context. i.e. from the same data set...
Definition: ObjectIdSet.h:55
URI C++ Library.
Enumerations related to Vector Processing module.
const te::da::ObjectIdSet * m_oidSet
Definition: AggregationOp.h:86
Configuration flags for the Terrralib Vector Processing module.