25 #include "../common/StringUtils.h"
27 #include "../datatype/Enums.h"
28 #include "../datatype/Property.h"
30 #include "../geometry/Enums.h"
31 #include "../geometry/GeometryProperty.h"
44 std::string inDsetName,
45 std::auto_ptr<te::da::DataSetTypeConverter> converter,
49 m_inDsetName = inDsetName;
50 m_converter = converter;
65 std::string dSourceType = m_outDsrc->getType();
67 std::vector<te::dt::Property*> vecProps = m_converter->getResult()->getProperties();
69 std::vector<te::dt::Property*> inPk = m_converter->getResult()->getPrimaryKey()->getProperties();
70 std::string namePk = m_outDset;
72 for (std::size_t p = 0; p < inPk.size(); ++p)
73 namePk +=
"_" + inPk[p]->getName();
77 if(dSourceType ==
"OGR")
79 for(std::size_t i = 0; i < vecProps.size(); ++i)
83 outDsType->add(vecProps[i]->clone());
92 outDsType->add(outGeom);
98 for(std::size_t i = 0; i < vecProps.size(); ++i)
102 outDsType->add(vecProps[i]->clone());
104 for (std::size_t j = 0; j < inPk.size(); ++j)
106 if (outDsType->getProperty(i)->getName() == inPk[j]->getName())
107 pk->
add(outDsType->getProperty(i));
116 outDsType->add(outGeom);
121 outDsType->setPrimaryKey(pk);
145 if (m_inDsetName.empty())
148 if (m_outDset.empty() || !m_outDsrc.get())
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.
void setInput(te::da::DataSourcePtr inDsrc, std::string inDsetName, std::auto_ptr< te::da::DataSetTypeConverter > converter, const te::da::ObjectIdSet *oidSet=0)
virtual bool paramsAreValid()
std::auto_ptr< te::da::DataSetType > buildOutDataSetType()
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)
Polygon to line operation.
void setOutput(te::da::DataSourcePtr outDsrc, std::string dsname)
It describes a primary key (pk) constraint.
const std::string & getName() const
It returns the property name.