24 #include "../common/Logger.h"
25 #include "../dataaccess/dataset/DataSet.h"
26 #include "../dataaccess/dataset/DataSetAdapter.h"
27 #include "../dataaccess/dataset/DataSetType.h"
28 #include "../dataaccess/dataset/DataSetTypeConverter.h"
29 #include "../dataaccess/dataset/ObjectIdSet.h"
30 #include "../dataaccess/datasource/DataSource.h"
31 #include "../dataaccess/datasource/DataSourceCapabilities.h"
32 #include "../dataaccess/utils/Utils.h"
34 #include "../datatype/Property.h"
35 #include "../datatype/StringProperty.h"
37 #include "../geometry/GeometryProperty.h"
39 #include "../statistics/core/Utils.h"
56 m_fromLayer = fromLayer;
63 m_toLayerProps = toLayerProps;
100 if (m_outDsrc->getCapabilities().getDataSetTypeCapabilities().supportsPrimaryKey())
102 std::string pk_name = dsTypeResult->getName() +
"_pkey";
104 pk->
add(dsTypeResult->getProperty(0));
105 outDsType->setPrimaryKey(pk);
108 std::map<std::string, std::string> options;
110 m_outDsrc->createDataSet(dsTypeResult, options);
113 result->moveBeforeFirst();
114 m_outDsrc->add(dsTypeResult->getName(),result.get(), options);
118 #ifdef TERRALIB_LOGGER_ENABLED
119 std::string ex = e.
what();
120 ex +=
" | Ref: SAVE";
121 te::common::Logger::logDebug(
"attributefill", ex.c_str());
122 #endif //TERRALIB_LOGGER_ENABLED
126 catch(std::exception& e)
128 #ifdef TERRALIB_LOGGER_ENABLED
129 std::string ex = e.what();
130 ex +=
" | Ref: SAVE";
131 te::common::Logger::logDebug(
"attributefill", ex.c_str());
132 #endif //TERRALIB_LOGGER_ENABLED
void add(te::dt::Property *p)
It adds a property to the list of properties of the primary key.
void setInput(te::map::AbstractLayerPtr fromLayer, te::map::AbstractLayerPtr toLayer)
void setOutput(te::da::DataSourcePtr outDsrc, std::string dsName)
boost::shared_ptr< DataSource > DataSourcePtr
A class that models the description of a dataset.
virtual const char * what() const
It outputs the exception message.
DataSetType * getResult() const
void setParams(const std::map< std::string, std::vector< te::attributefill::OperationType > > &options, std::vector< std::string > toLayerProps)
An converter for DataSetType.
bool save(std::auto_ptr< te::mem::DataSet > result, std::auto_ptr< te::da::DataSetType > outDsType)
This class is designed to declare objects to be thrown as exceptions by TerraLib. ...
It describes a primary key (pk) constraint.
Vector To Vector operation.
virtual ~VectorToVectorOp()
TEDATAACCESSEXPORT DataSetAdapter * CreateAdapter(DataSet *ds, DataSetTypeConverter *converter, bool isOwner=false)
virtual bool paramsAreValid()
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr