25 #include "../datatype/Enums.h"
26 #include "../datatype/Property.h"
28 #include "../geometry/Enums.h"
29 #include "../geometry/GeometryProperty.h"
46 if (m_inDsetName.empty())
49 if (m_outDset.empty() || !m_outDsrc.get())
56 std::string inDsetName,
60 m_inDsetName = inDsetName;
72 std::auto_ptr<te::da::DataSetType> inDsType = m_inDsrc->getDataSetType(m_inDsetName);
75 std::string dSourceType = m_outDsrc->getType();
77 std::vector<te::dt::Property*> vecProps = inDsType->getProperties();
79 std::vector<te::dt::Property*> inPk = inDsType->getPrimaryKey()->getProperties();
80 std::string namePk = m_outDset;
82 for (std::size_t p = 0; p < inPk.size(); ++p)
83 namePk +=
"_" + inPk[p]->getName();
87 if(dSourceType ==
"OGR")
89 for(std::size_t i = 0; i < vecProps.size(); ++i)
93 outDsType->add(vecProps[i]->clone());
102 outDsType->add(outGeom);
108 for(std::size_t i = 0; i < vecProps.size(); ++i)
112 outDsType->add(vecProps[i]->clone());
114 for (std::size_t j = 0; j < inPk.size(); ++j)
116 if (outDsType->getProperty(i)->getName() == inPk[j]->getName())
117 pk->
add(outDsType->getProperty(i));
126 outDsType->add(outGeom);
131 outDsType->setPrimaryKey(pk);
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 setSRID(int srid)
It sets the spatial reference system identifier associated to this property.
void setGeometryType(GeomType t)
It sets the geometry subtype.
boost::shared_ptr< DataSource > DataSourcePtr
A class that models the description of a dataset.
Line to polygon operation.
int getSRID() const
It returns the spatial reference system identifier associated to this property.
This class represents a set of unique ids created in the same context. i.e. from the same data set...
te::gm::GeomType getGeomResultType(te::gm::GeomType geom)
It describes a primary key (pk) constraint.
void setOutput(te::da::DataSourcePtr outDsrc, std::string dsname)
void setInput(te::da::DataSourcePtr inDsrc, std::string inDsetName, const te::da::ObjectIdSet *oidSet=0)
std::auto_ptr< te::da::DataSetType > buildOutDataSetType()
virtual bool paramsAreValid()
const std::string & getName() const
It returns the property name.