27 #include "../common/Translator.h"
28 #include "../datatype/ByteArray.h"
29 #include "../datatype/Enums.h"
30 #include "../datatype/SimpleData.h"
40 throw Exception(
TE_TR(
"The input data type is not a geometry!"));
43 char* wkb =
static_cast<const Geometry*
>(d)->asBinary(size);
51 throw Exception(
TE_TR(
"The input data type is not a geometry!"));
53 return new te::dt::String(static_cast<const Geometry*>(d)->asText());
59 throw Exception(
TE_TR(
"The input data type is not a byte array!"));
61 return WKBReader::read(static_cast<const te::dt::ByteArray*>(d)->getData());
67 throw Exception(
TE_TR(
"The input data type is not a string!"));
69 return WKTReader::read(static_cast<const te::dt::String*>(d)->getValue().c_str());
A set of function that convert a Geometry type to other types and vice-versa.
SimpleData< std::string, STRING_TYPE > String
te::dt::AbstractData * GeometryToByteArrayConverter(te::dt::AbstractData *d)
It converts a Geometry data value to a ByteArray data value.
virtual int getTypeCode() const =0
It returns the data type code associated to the data value.
#define TE_TR(message)
It marks a string in order to get translated.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
te::dt::AbstractData * GeometryToStringConverter(te::dt::AbstractData *d)
It converts a Geometry data value to a String data value.
te::dt::AbstractData * ByteArrayToGeometryConverter(te::dt::AbstractData *d)
It converts a ByteArray data value to a Geometry data value.
A base class for values that can be retrieved from the data access module.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
An exception class for the Geometry module.
A class that deserializes a geometry from a valid WKB.
te::dt::AbstractData * StringToGeometryConverter(te::dt::AbstractData *d)
It converts a String data value to a Geometry data value.
A class that deserializes a geometry from a valid WKT.
A class for representing binary data.