27 #include "../../core/encoding/CharEncoding.h" 28 #include "../../datatype/DataConverterManager.h" 29 #include "../../datatype/SimpleData.h" 30 #include "../../geometry/Point.h" 40 assert(indexes.size() == 1);
42 if(dataset->
isNull(indexes[0]))
46 std::unique_ptr<te::dt::AbstractData> data(dataset->
getValue(indexes[0]));
52 if(srcType == dstType)
53 return data.release();
60 assert(convertedData);
68 assert(indexes.size() == 2);
70 double x = dataset->
getDouble(indexes[0]);
71 double y = dataset->
getDouble(indexes[1]);
83 assert(indexes.size() == 3);
85 double x = dataset->
getDouble(indexes[0]);
86 double y = dataset->
getDouble(indexes[1]);
87 double z = dataset->
getDouble(indexes[2]);
98 assert(indexes.size() == 3);
100 double x = dataset->
getDouble(indexes[0]);
101 double y = dataset->
getDouble(indexes[1]);
102 double m = dataset->
getDouble(indexes[2]);
113 assert(indexes.size() == 4);
115 double x = dataset->
getDouble(indexes[0]);
116 double y = dataset->
getDouble(indexes[1]);
117 double z = dataset->
getDouble(indexes[2]);
118 double m = dataset->
getDouble(indexes[3]);
130 assert(indexes.size() == 1);
140 assert(indexes.size() == 1);
150 assert(indexes.size() == 1);
160 assert(indexes.size() == 1);
171 std::string result =
"[ ";
173 std::vector<std::size_t>::const_iterator it;
174 for(it = indexes.begin(); it != indexes.end(); ++it)
185 assert(indexes.size() == 1);
187 std::size_t pos = indexes[0];
195 std::string value = dataset->
getString(pos);
212 DataSet* dataset,
const std::vector<std::size_t>& indexes,
int )
214 assert(indexes.size() == 1);
216 if (dataset->
isNull(indexes[0]))
220 std::unique_ptr<te::gm::Geometry> geom(dataset->
getGeometry(indexes[0]));
225 geom->setSRID(m_inputSRID);
229 geom->transform(m_outputSRID);
231 return geom.release();
virtual std::unique_ptr< te::gm::Geometry > getGeometry(std::size_t i) const =0
Method for retrieving a geometric attribute value.
te::core::EncodingType m_toCode
SimpleData< std::string, STRING_TYPE > String
virtual double getDouble(std::size_t i) const =0
Method for retrieving a double attribute value.
TEDATAACCESSEXPORT te::dt::AbstractData * XYMToPointConverter(DataSet *dataset, const std::vector< std::size_t > &indexes, int dstType)
#define TE_UNKNOWN_SRS
A numeric value to represent a unknown SRS identification in TerraLib.
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)
TEDATAACCESSEXPORT te::dt::AbstractData * PointToXConverter(DataSet *dataset, const std::vector< std::size_t > &indexes, int dstType)
static std::string fromUTF8(const std::string &src)
Convert a string in UTF-8 to the current locale encoding.
static DataConverterManager & getInstance()
It returns a reference to the singleton instance.
A point with x and y coordinate values.
virtual int getPropertyDataType(std::size_t i) const =0
It returns the underlying data type of the property at position pos.
void setM(const double &m)
It sets the Point m-coordinate value.
TEDATAACCESSEXPORT te::dt::AbstractData * PointToZConverter(DataSet *dataset, const std::vector< std::size_t > &indexes, int dstType)
te::dt::AbstractData * operator()(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 int getTypeCode() const =0
It returns the data type code associated to the data value.
A dataset is the unit of information manipulated by the data access module of TerraLib.
void setX(const double &x)
It sets the Point x-coordinate value.
TEDATAACCESSEXPORT te::dt::AbstractData * XYZToPointConverter(DataSet *dataset, const std::vector< std::size_t > &indexes, int dstType)
virtual std::unique_ptr< te::dt::AbstractData > getValue(std::size_t i) const
Method for retrieving any other type of data value stored in the data source.
SimpleData< double, DOUBLE_TYPE > Double
virtual bool isNull(std::size_t i) const =0
It checks if the attribute value is NULL.
boost::function1< AbstractData *, AbstractData * > DataTypeConverter
The definition of the data type converter.
void setY(const double &y)
It sets the Point y-coordinate value.
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.
TEDATAACCESSEXPORT te::dt::AbstractData * XYZMToPointConverter(DataSet *dataset, const std::vector< std::size_t > &indexes, int dstType)
virtual std::string getString(std::size_t i) const =0
Method for retrieving a string value attribute.
void setZ(const double &z)
It sets the Point z-coordinate value.
TEDATAACCESSEXPORT te::dt::AbstractData * TupleToStringConverter(DataSet *dataset, const std::vector< std::size_t > &indexes, int dstType)