24 #include "../dataaccess/dataset/DataSet.h"
25 #include "../dataaccess/dataset/DataSetAdapter.h"
26 #include "../dataaccess/dataset/DataSetType.h"
27 #include "../dataaccess/dataset/DataSetTypeConverter.h"
28 #include "../dataaccess/datasource/DataSource.h"
29 #include "../dataaccess/datasource/DataSourceCapabilities.h"
30 #include "../dataaccess/utils/Utils.h"
32 #include "../datatype/Property.h"
33 #include "../datatype/StringProperty.h"
35 #include "../geometry/GeometryProperty.h"
37 #include "../statistics/core/Utils.h"
47 std::string inFirstDsetName,
48 std::auto_ptr<te::da::DataSetType> inFirstDsetType,
50 std::string inSecondDsetName,
51 std::auto_ptr<te::da::DataSetType> inSecondDsetType,
55 m_inFirstDsrc = inFirstDsrc;
56 m_inFirstDsetName = inFirstDsetName;
57 m_inFirstDsetType = inFirstDsetType;
58 m_inSecondDsrc = inSecondDsrc;
59 m_inSecondDsetName = inSecondDsetName;
60 m_inSecondDsetType = inSecondDsetType;
62 m_firstOidSet = firstOidSet;
63 m_secondOidSet = secondOidSet;
69 m_copyInputColumns = copyInputColumns;
76 m_outDsetName = dsname;
95 if (!m_inFirstDsetType.get())
98 if (!m_inFirstDsetType->hasGeom())
101 if (!m_inSecondDsetType.get())
104 if (!m_inSecondDsetType->hasGeom())
107 if (m_outDsetName.empty() || !m_outDsrc.get())
120 std::map<std::string, std::string> options;
122 m_outDsrc->createDataSet(dsTypeResult, options);
125 result->moveBeforeFirst();
126 m_outDsrc->add(dsTypeResult->getName(),result.get(), options);
129 if (m_outDsrc->getCapabilities().getDataSetTypeCapabilities().supportsPrimaryKey())
131 std::string pk_name = dsTypeResult->getName() +
"_pkey";
133 pk->
add(dsTypeResult->getProperty(0));
134 m_outDsrc->addPrimaryKey(m_outDsetName,pk);
142 std::vector<te::dt::Property*> props;
145 for(std::size_t i = 0; i < dsType->
getProperties().size(); ++i)
151 props.push_back(prop);
std::vector< te::dt::Property * > getTabularProps(te::da::DataSetType *dsType)
Property * getProperty(std::size_t i) const
It returns the i-th property.
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 setInput(te::da::DataSourcePtr inFirstDsrc, std::string inFirstDsetName, std::auto_ptr< te::da::DataSetType > inFirstDsetType, te::da::DataSourcePtr inSecondDsrc, std::string inSecondDsetName, std::auto_ptr< te::da::DataSetType > inSecondDsetType, const te::da::ObjectIdSet *firstOidSet=0, const te::da::ObjectIdSet *secondOidSet=0)
boost::shared_ptr< DataSource > DataSourcePtr
A class that models the description of a dataset.
bool save(std::auto_ptr< te::da::DataSet > result, std::auto_ptr< te::da::DataSetType > outDsType)
DataSetType * getResult() const
virtual bool paramsAreValid()
It models a property definition.
An converter for DataSetType.
const std::vector< Property * > & getProperties() const
It returns the list of properties describing the CompositeProperty.
This class represents a set of unique ids created in the same context. i.e. from the same data set...
void setOutput(te::da::DataSourcePtr outDsrc, std::string dsname)
void setParams(const bool ©InputColumns, std::size_t inSRID)
int getType() const
It returns the property data type.
It describes a primary key (pk) constraint.
TEDATAACCESSEXPORT DataSetAdapter * CreateAdapter(DataSet *ds, DataSetTypeConverter *converter, bool isOwner=false)
te::gm::GeomType getGeomResultType(te::gm::GeomType geom)