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