An utility class for writing a PostGIS EWKB. More...
#include <EWKBWriter.h>
Public Member Functions | |
EWKBWriter (char *ewkb, te::common::MachineByteOrder byteOrder=te::common::NDR) | |
It constructs a new EWKB writer. More... | |
void | reset (char *ewkb, te::common::MachineByteOrder byteOrder=te::common::NDR) |
It resets the EWKB writer an allows a new geometry to be seriealized to a new buffer. More... | |
void | write (const te::gm::Geometry *geom) |
It serializes the geometry to an EWKB representation into the specified buffer. More... | |
~EWKBWriter () | |
Destructor. More... | |
Static Public Member Functions | |
static void | write (const te::gm::Geometry *geom, char *ewkb, te::common::MachineByteOrder byteOrder=te::common::NDR) |
It serializes the geometry to an EWKB representation into the specified buffer. More... | |
Private Attributes | |
te::common::MachineByteOrder | m_byteOrder |
The byte order used to encode the EWKB. More... | |
char * | m_ewkb |
A pointer that marks the current position in a buffer to be write when parsing the geometry. More... | |
bool | m_outputSRID |
If true we add a bit indicating that the srid will be outputed with the gometry. More... | |
An utility class for writing a PostGIS EWKB.
Definition at line 48 of file EWKBWriter.h.
te::pgis::EWKBWriter::EWKBWriter | ( | char * | ewkb, |
te::common::MachineByteOrder | byteOrder = te::common::NDR |
||
) |
It constructs a new EWKB writer.
ewkb | A pointer to a buffer to output the ewkb. It must have at least the size in bytes necessary to write the EWKB. |
byteOrder | The byte order to be used to encode the WKB. |
Definition at line 92 of file EWKBWriter.cpp.
te::pgis::EWKBWriter::~EWKBWriter | ( | ) |
Destructor.
Definition at line 100 of file EWKBWriter.cpp.
void te::pgis::EWKBWriter::reset | ( | char * | ewkb, |
te::common::MachineByteOrder | byteOrder = te::common::NDR |
||
) |
It resets the EWKB writer an allows a new geometry to be seriealized to a new buffer.
ewkb | A pointer to a buffer to output the ewkb. It must have at least the size in bytes necessary to write the EWKB. |
byteOrder | The byte order to be used to encode the EWKB. |
Definition at line 116 of file EWKBWriter.cpp.
|
inlineprotectedvirtual |
Implements te::gm::Visitor.
Definition at line 95 of file EWKBWriter.h.
|
inlineprotectedvirtual |
Implements te::gm::Visitor.
Definition at line 96 of file EWKBWriter.h.
|
protectedvirtual |
Implements te::gm::Visitor.
Definition at line 123 of file EWKBWriter.cpp.
References te::common::BaseVisitable< T, R >::accept(), te::pgis::Convert2PostGISWKBType(), te::gm::GeometryCollection::getGeometryN(), te::gm::Geometry::getGeomTypeId(), te::gm::GeometryCollection::getNumGeometries(), te::gm::Geometry::getSRID(), PGIS_UNKNOWN_SRS, te::common::Globals::sm_machineByteOrder, TE_EWKB_SRID_FLAG, and TE_UNKNOWN_SRS.
|
protectedvirtual |
|
protectedvirtual |
Implements te::gm::Visitor.
Definition at line 164 of file EWKBWriter.cpp.
References te::pgis::Convert2PostGISWKBType(), te::gm::Geometry::getGeomTypeId(), te::gm::Geometry::getSRID(), PGIS_UNKNOWN_SRS, te::common::Globals::sm_machineByteOrder, TE_EWKB_SRID_FLAG, TE_UNKNOWN_SRS, and Write2EWKB().
|
inlineprotectedvirtual |
Implements te::gm::Visitor.
Definition at line 100 of file EWKBWriter.h.
|
protectedvirtual |
Implements te::gm::Visitor.
Definition at line 196 of file EWKBWriter.cpp.
|
protectedvirtual |
Implements te::gm::Visitor.
Definition at line 201 of file EWKBWriter.cpp.
|
protectedvirtual |
Implements te::gm::Visitor.
Definition at line 206 of file EWKBWriter.cpp.
|
inlineprotectedvirtual |
Implements te::gm::Visitor.
Definition at line 104 of file EWKBWriter.h.
|
inlineprotectedvirtual |
Implements te::gm::Visitor.
Definition at line 105 of file EWKBWriter.h.
|
protectedvirtual |
Implements te::gm::Visitor.
Definition at line 211 of file EWKBWriter.cpp.
References te::pgis::Convert2PostGISWKBType(), te::gm::Geometry::getGeomTypeId(), te::gm::Point::getM(), te::gm::Geometry::getSRID(), te::gm::Point::getX(), te::gm::Point::getY(), te::gm::Point::getZ(), PGIS_UNKNOWN_SRS, te::common::Globals::sm_machineByteOrder, TE_EWKB_M_OFFSET, TE_EWKB_SRID_FLAG, TE_EWKB_Z_OFFSET, and TE_UNKNOWN_SRS.
|
protectedvirtual |
Implements te::gm::Visitor.
Definition at line 260 of file EWKBWriter.cpp.
|
protectedvirtual |
Implements te::gm::Visitor.
Definition at line 265 of file EWKBWriter.cpp.
|
protectedvirtual |
Implements te::gm::Visitor.
Definition at line 270 of file EWKBWriter.cpp.
|
inlineprotectedvirtual |
Implements te::gm::Visitor.
Definition at line 110 of file EWKBWriter.h.
|
protectedvirtual |
Implements te::gm::Visitor.
Definition at line 275 of file EWKBWriter.cpp.
References te::common::BaseVisitable< T, R >::accept(), te::pgis::Convert2PostGISWKBType(), te::gm::Geometry::getGeomTypeId(), te::gm::CurvePolygon::getNumRings(), te::gm::CurvePolygon::getRingN(), te::gm::Geometry::getSRID(), PGIS_UNKNOWN_SRS, te::common::Globals::sm_machineByteOrder, TE_EWKB_SRID_FLAG, and TE_UNKNOWN_SRS.
|
inlineprotectedvirtual |
Implements te::gm::Visitor.
Definition at line 112 of file EWKBWriter.h.
|
inlineprotectedvirtual |
Implements te::gm::Visitor.
Definition at line 113 of file EWKBWriter.h.
|
inlineprotectedvirtual |
Implements te::gm::Visitor.
Definition at line 114 of file EWKBWriter.h.
|
inlineprotectedvirtual |
Implements te::gm::Visitor.
Definition at line 115 of file EWKBWriter.h.
|
inlineprotectedvirtual |
Implements te::gm::Visitor.
Definition at line 116 of file EWKBWriter.h.
|
inlineprotectedvirtual |
Implements te::gm::Visitor.
Definition at line 117 of file EWKBWriter.h.
|
inlineprotectedvirtual |
Implements te::gm::Visitor.
Definition at line 118 of file EWKBWriter.h.
void te::pgis::EWKBWriter::write | ( | const te::gm::Geometry * | geom | ) |
It serializes the geometry to an EWKB representation into the specified buffer.
geom | The geometry to be serialized. |
Definition at line 104 of file EWKBWriter.cpp.
References te::common::BaseVisitable< T, R >::accept().
Referenced by te::pgis::PreparedQuery::bind().
|
static |
It serializes the geometry to an EWKB representation into the specified buffer.
The ewkb parameter must have at least geom.getWkbSize() + 4 bytes in order to be used. Don't pass a NULL pointer or a buffer smaller than the size needed. Note that the EWKB will be on the specified byte order.
geom | The geometry to be serialized. |
ewkb | The buffer where the geometry will be serialized. |
byteOrder | The byte order used to store/serialize the geometry. |
Definition at line 109 of file EWKBWriter.cpp.
References te::common::BaseVisitable< T, R >::accept().
|
private |
The byte order used to encode the EWKB.
Definition at line 123 of file EWKBWriter.h.
|
private |
A pointer that marks the current position in a buffer to be write when parsing the geometry.
Definition at line 122 of file EWKBWriter.h.
|
private |
If true we add a bit indicating that the srid will be outputed with the gometry.
Definition at line 124 of file EWKBWriter.h.