27 #include "../../datatype/DataConverterManager.h"
28 #include "../../datatype/SimpleData.h"
29 #include "../../geometry/Point.h"
30 #include "../../geometry/PointM.h"
31 #include "../../geometry/PointZ.h"
32 #include "../../geometry/PointZM.h"
42 assert(indexes.size() == 1);
44 if(dataset->
isNull(indexes[0]))
48 std::auto_ptr<te::dt::AbstractData> data(dataset->
getValue(indexes[0]));
53 if(srcType == dstType)
54 return data.release();
61 assert(convertedData);
69 assert(indexes.size() == 2);
71 double x = dataset->
getDouble(indexes[0]);
72 double y = dataset->
getDouble(indexes[1]);
80 assert(indexes.size() == 3);
82 double x = dataset->
getDouble(indexes[0]);
83 double y = dataset->
getDouble(indexes[1]);
84 double z = dataset->
getDouble(indexes[2]);
92 assert(indexes.size() == 3);
94 double x = dataset->
getDouble(indexes[0]);
95 double y = dataset->
getDouble(indexes[1]);
96 double m = dataset->
getDouble(indexes[2]);
104 assert(indexes.size() == 4);
106 double x = dataset->
getDouble(indexes[0]);
107 double y = dataset->
getDouble(indexes[1]);
108 double z = dataset->
getDouble(indexes[2]);
109 double m = dataset->
getDouble(indexes[3]);
117 assert(indexes.size() == 1);
127 assert(indexes.size() == 1);
137 assert(indexes.size() == 1);
147 assert(indexes.size() == 1);
158 std::string result =
"[ ";
160 std::vector<std::size_t>::const_iterator it;
161 for(it = indexes.begin(); it != indexes.end(); ++it)
172 assert(indexes.size() == 1);
174 std::size_t pos = indexes[0];
179 std::string value = dataset->
getString(pos);
188 #ifdef TERRALIB_CHARENCODING_ENABLED
SimpleData< std::string, STRING_TYPE > String
TEDATAACCESSEXPORT te::dt::AbstractData * XYMToPointConverter(DataSet *dataset, const std::vector< std::size_t > &indexes, int dstType)
CharEncoding
Supported charsets (character encoding).
TEDATAACCESSEXPORT te::dt::AbstractData * PointToMConverter(DataSet *dataset, const std::vector< std::size_t > &indexes, int dstType)
TEDATAACCESSEXPORT te::dt::AbstractData * GenericAttributeConverter(DataSet *dataset, const std::vector< std::size_t > &indexes, int dstType)
virtual int getTypeCode() const =0
It returns the data type code associated to the data value.
static std::string convert(const std::string &src, const CharEncoding &fromCode, const CharEncoding &toCode)
An static method that converts the source string to a target charset.
TEDATAACCESSEXPORT te::dt::AbstractData * PointToXConverter(DataSet *dataset, const std::vector< std::size_t > &indexes, int dstType)
A point with a z-coordinate value and an associated measurement.
virtual double getDouble(std::size_t i) const =0
Method for retrieving a double attribute value.
A point with an associated measure.
A point with z-coordinate value.
static DataConverterManager & getInstance()
It returns a reference to the singleton instance.
A point with x and y coordinate values.
virtual bool isNull(std::size_t i) const =0
It checks if the attribute value is NULL.
virtual te::common::CharEncoding getPropertyCharEncoding(std::size_t i) const =0
It returns the property character encoding at position pos.
TEDATAACCESSEXPORT te::dt::AbstractData * PointToZConverter(DataSet *dataset, const std::vector< std::size_t > &indexes, int dstType)
virtual std::string getAsString(std::size_t i, int precision=0) const
Method for retrieving a data value as a string plain representation.
A base class for values that can be retrieved from the data access module.
TEDATAACCESSEXPORT te::dt::AbstractData * XYToPointConverter(DataSet *dataset, const std::vector< std::size_t > &indexes, int dstType)
Definition of attribute converter and a set of them.
te::dt::AbstractData * operator()(DataSet *dataset, const std::vector< std::size_t > &indexes, int dstType)
virtual std::auto_ptr< te::gm::Geometry > getGeometry(std::size_t i) const =0
Method for retrieving a geometric attribute value.
A dataset is the unit of information manipulated by the data access module of TerraLib.
TEDATAACCESSEXPORT te::dt::AbstractData * XYZToPointConverter(DataSet *dataset, const std::vector< std::size_t > &indexes, int dstType)
SimpleData< double, DOUBLE_TYPE > Double
te::common::CharEncoding m_toCode
boost::function1< AbstractData *, AbstractData * > DataTypeConverter
The definition of the data type converter.
virtual std::string getString(std::size_t i) const =0
Method for retrieving a string value attribute.
TEDATAACCESSEXPORT te::dt::AbstractData * PointToYConverter(DataSet *dataset, const std::vector< std::size_t > &indexes, int dstType)
A dataset is the unit of information manipulated by the data access module of TerraLib.
virtual int getPropertyDataType(std::size_t i) const =0
It returns the underlying data type of the property at position pos.
TEDATAACCESSEXPORT te::dt::AbstractData * XYZMToPointConverter(DataSet *dataset, const std::vector< std::size_t > &indexes, int dstType)
virtual std::auto_ptr< te::dt::AbstractData > getValue(std::size_t i) const
Method for retrieving any other type of data value stored in the data source.
TEDATAACCESSEXPORT te::dt::AbstractData * TupleToStringConverter(DataSet *dataset, const std::vector< std::size_t > &indexes, int dstType)