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"
48 if (m_inDsetName.empty())
51 if (m_outDset.empty() || !m_outDsrc.get())
58 std::string inDsetName,
59 std::auto_ptr<te::da::DataSetTypeConverter> converter,
63 m_inDsetName = inDsetName;
64 m_converter = converter;
78 std::string dSourceType = m_outDsrc->getType();
80 std::vector<te::dt::Property*> vecProps = m_converter->getResult()->getProperties();
82 std::vector<te::dt::Property*> inPk = m_converter->getResult()->getPrimaryKey()->getProperties();
83 std::string namePk = m_outDset;
85 for (std::size_t p = 0; p < inPk.size(); ++p)
86 namePk +=
"_" + inPk[p]->getName();
90 if(dSourceType ==
"OGR")
92 for(std::size_t i = 0; i < vecProps.size(); ++i)
96 outDsType->add(vecProps[i]->clone());
105 outDsType->add(outGeom);
111 for(std::size_t i = 0; i < vecProps.size(); ++i)
115 outDsType->add(vecProps[i]->clone());
117 for (std::size_t j = 0; j < inPk.size(); ++j)
119 if (outDsType->getProperty(i)->getName() == inPk[j]->getName())
120 pk->
add(outDsType->getProperty(i));
129 outDsType->add(outGeom);
132 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)
std::auto_ptr< te::da::DataSetType > buildOutDataSetType()
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()
const std::string & getName() const
It returns the property name.