24 #include "../core/logger/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/datasource/DataSourceTransactor.h" 33 #include "../dataaccess/utils/Utils.h" 35 #include "../datatype/Property.h" 36 #include "../datatype/StringProperty.h" 38 #include "../geometry/GeometryProperty.h" 40 #include "../statistics/core/Utils.h" 90 std::unique_ptr<te::da::DataSourceTransactor> t;
99 if (
m_outDsrc->getCapabilities().getDataSetTypeCapabilities().supportsPrimaryKey())
101 std::string pk_name = dsTypeResult->getName() +
"_pkey";
103 pk->
add(dsTypeResult->getProperty(0));
104 outDsType->setPrimaryKey(pk);
111 std::map<std::string, std::string> options;
113 m_outDsrc->createDataSet(dsTypeResult, options);
116 result->moveBeforeFirst();
117 m_outDsrc->add(dsTypeResult->getName(),result.get(), options);
123 #ifdef TERRALIB_LOGGER_ENABLED 124 std::string ex = e.
what();
125 ex +=
" | Ref: Error while persisting in the DataSource";
127 #endif //TERRALIB_LOGGER_ENABLED 131 catch(std::exception& e)
133 #ifdef TERRALIB_LOGGER_ENABLED 134 std::string ex = e.what();
135 ex +=
" | Ref: Error while persisting in the DataSource";
137 #endif //TERRALIB_LOGGER_ENABLED bool save(std::unique_ptr< te::mem::DataSet > result, std::unique_ptr< te::da::DataSetType > outDsType)
std::vector< std::string > m_toLayerProps
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)
te::map::AbstractLayerPtr m_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.
#define TE_CORE_LOG_DEBUG(channel, message)
Use this tag in order to log a message to a specified logger with the DEBUG level.
std::map< std::string, std::vector< te::attributefill::OperationType > > m_options
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.
te::da::DataSourcePtr m_outDsrc
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()
te::map::AbstractLayerPtr m_fromLayer
TEDATAACCESSEXPORT DataSetAdapter * CreateAdapter(DataSet *ds, DataSetTypeConverter *converter, bool isOwner=false)
virtual bool paramsAreValid()
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr