27 #include "../dataaccess/dataset/DataSet.h"
29 #include "../datatype/Property.h"
31 #include "../dataaccess/query/DataSetName.h"
32 #include "../dataaccess/query/Expression.h"
33 #include "../dataaccess/query/Field.h"
34 #include "../dataaccess/query/Fields.h"
35 #include "../dataaccess/query/From.h"
36 #include "../dataaccess/query/FromItem.h"
37 #include "../dataaccess/query/GroupBy.h"
38 #include "../dataaccess/query/GroupByItem.h"
39 #include "../dataaccess/query/LiteralInt32.h"
40 #include "../dataaccess/query/PropertyName.h"
41 #include "../dataaccess/query/Select.h"
42 #include "../dataaccess/query/ST_Dump.h"
43 #include "../dataaccess/query/ST_Collect.h"
44 #include "../dataaccess/query/ST_MakePolygon.h"
45 #include "../dataaccess/query/ST_SetSRID.h"
46 #include "../dataaccess/query/SubSelect.h"
47 #include "../dataaccess/query/Where.h"
48 #include "../dataaccess/utils/Utils.h"
50 #include "../geometry/GeometryProperty.h"
67 std::auto_ptr<te::da::DataSetType> outDsType = buildOutDataSetType();
68 std::vector<te::dt::Property*> props = outDsType->getProperties();
71 std::auto_ptr<te::da::DataSetType> sourceDSetType(m_inDsrc->getDataSetType(m_inDsetName));
78 for(std::size_t i = 0; i < props.size(); ++i)
84 pol_fields->push_back(field);
90 if (geomPropSource->getSRID() != geomProp->getSRID())
103 pol_fields->push_back(f_makePolygon);
109 fromPol->push_back(fromItemPol);
121 for(std::size_t i = 0; i < props.size(); ++i)
127 line_fields->push_back(field);
134 line_fields->push_back(f_collect);
140 from->push_back(fromItem);
146 for(std::size_t i = 0; i < props.size(); ++i)
151 groupBy->push_back(e_groupBy);
156 std::auto_ptr<te::da::DataSet> dsQuery(m_inDsrc->query(select));
158 te::vp::Save(m_outDsrc.get(), dsQuery.get(), outDsType.get());
boost::ptr_vector< GroupByItem > GroupBy
A class that can be used to model a GROUP BY clause.
Utility functions for the data access module.
A class that can be used in a GROUP BY clause.
An abstract class that models a source of data in a query.
The Field class can be used to model an expression that takes part of the output items of a SELECT...
A class that models the name of a dataset used in a From clause.
A class that models the name of any property of an object.
void Save(te::da::DataSource *source, te::da::DataSet *result, te::da::DataSetType *outDsType)
ST_Collect statistical function.
This is an abstract class that models a query expression.
ST_MakePolygon statistical function.
boost::ptr_vector< Field > Fields
Fields is just a boost::ptr_vector of Field pointers.
A class that can be used to model a filter expression that can be applied to a query.
void setGroupBy(GroupBy *g)
It sets the list of expressions used to condense the result set.
ST_Dump statistical function.
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.
Spatial Set SRID operator.
Line To Polygon Vector Processing functions.
A Select can be used as a source of information in another query.
TEDATAACCESSEXPORT te::gm::GeometryProperty * GetFirstGeomProperty(const DataSetType *dt)