A class that serializes a geometry to the WKB format. More...
#include <WKBWriter.h>
Public Member Functions | |
| void | reset (char *wkb, te::common::MachineByteOrder byteOrder=te::common::NDR) |
| It resets the WKB writer an allows a new geometry to be seriealized to a new buffer. More... | |
| WKBWriter (char *wkb, te::common::MachineByteOrder byteOrder=te::common::NDR) | |
| It constructs a new WKB writer. More... | |
| void | write (const Geometry *geom) |
| It serializes the geometry to a WKB representation into the specified buffer. More... | |
| ~WKBWriter () | |
| Destructor. More... | |
Static Public Member Functions | |
| static void | write (const Geometry *geom, char *wkb, te::common::MachineByteOrder byteOrder=te::common::NDR) |
| It serializes the geometry to a WKB representation into the specified buffer. More... | |
Protected Member Functions | |
| void | visit (const Curve &) |
| void | visit (const Geometry &) |
| void | visit (const GeometryCollection &visited) |
| void | visit (const LinearRing &visited) |
| void | visit (const LineString &visited) |
| void | visit (const MultiCurve &) |
| void | visit (const MultiLineString &visited) |
| void | visit (const MultiPoint &visited) |
| void | visit (const MultiPolygon &visited) |
| void | visit (const MultiSurface &) |
| void | visit (const Point &visited) |
| void | visit (const Polygon &visited) |
| void | visit (const PolyhedralSurface &visited) |
| void | visit (const Surface &) |
| void | visit (const TIN &visited) |
| void | visit (const Triangle &visited) |
| void | visit (const CircularString &) |
| void | visit (const CompoundCurve &) |
| void | visit (const CurvePolygon &) |
Private Attributes | |
| te::common::MachineByteOrder | m_byteOrder |
| The byte order used to encode the WKB. More... | |
| char * | m_wkb |
| A pointer that marks the current position in a buffer to be write when parsing the geometry. More... | |
A class that serializes a geometry to the WKB format.
Definition at line 46 of file WKBWriter.h.
| te::gm::WKBWriter::WKBWriter | ( | char * | wkb, |
| te::common::MachineByteOrder | byteOrder = te::common::NDR |
||
| ) |
It constructs a new WKB writer.
| wkb | A pointer to a buffer to output the wkb. It must have at least the size in bytes necessary to write the WKB. |
| byteOrder | The byte order to be used to encode the WKB. |
Definition at line 137 of file WKBWriter.cpp.
References ~WKBWriter().
|
default |
Destructor.
Referenced by WKBWriter().
| void te::gm::WKBWriter::reset | ( | char * | wkb, |
| te::common::MachineByteOrder | byteOrder = te::common::NDR |
||
| ) |
It resets the WKB writer an allows a new geometry to be seriealized to a new buffer.
| wkb | A pointer to a buffer to output the wkb. It must have at least the size in bytes necessary to write the WKB. |
| byteOrder | The byte order to be used to encode the WKB. |
Definition at line 157 of file WKBWriter.cpp.
References m_byteOrder, and m_wkb.
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
Implements te::gm::Visitor.
Definition at line 94 of file WKBWriter.h.
|
protectedvirtual |
Implements te::gm::Visitor.
Definition at line 163 of file WKBWriter.cpp.
References te::common::BaseVisitable< T, R >::accept(), te::gm::GeometryCollection::getGeometryN(), te::gm::Geometry::getGeomTypeId(), te::gm::GeometryCollection::getNumGeometries(), m_byteOrder, m_wkb, te::common::Globals::sm_machineByteOrder, and te::common::SwapBytes().
|
protectedvirtual |
Implements te::gm::Visitor.
Definition at line 186 of file WKBWriter.cpp.
References m_byteOrder, m_wkb, te::gm::LineString::size(), and te::gm::Write2WKB().
|
protectedvirtual |
Implements te::gm::Visitor.
Definition at line 191 of file WKBWriter.cpp.
References te::gm::Geometry::getGeomTypeId(), m_byteOrder, m_wkb, te::gm::LineString::size(), te::common::Globals::sm_machineByteOrder, te::common::Swap4Bytes(), and te::gm::Write2WKB().
|
inlineprotectedvirtual |
Implements te::gm::Visitor.
Definition at line 98 of file WKBWriter.h.
|
protectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
|
inlineprotectedvirtual |
Implements te::gm::Visitor.
Definition at line 102 of file WKBWriter.h.
|
protectedvirtual |
Implements te::gm::Visitor.
Definition at line 220 of file WKBWriter.cpp.
References te::gm::Geometry::getGeomTypeId(), te::gm::Point::getM(), te::gm::Point::getX(), te::gm::Point::getY(), te::gm::Point::getZ(), m_byteOrder, m_wkb, te::gm::PointMType, te::gm::PointType, te::gm::PointZMType, te::gm::PointZType, te::common::Globals::sm_machineByteOrder, te::common::Swap4Bytes(), and te::common::Swap8Bytes().
|
protectedvirtual |
Implements te::gm::Visitor.
Definition at line 316 of file WKBWriter.cpp.
References te::common::BaseVisitable< T, R >::accept(), te::gm::Geometry::getGeomTypeId(), te::gm::CurvePolygon::getNumRings(), te::gm::CurvePolygon::getRingN(), m_byteOrder, m_wkb, te::common::Globals::sm_machineByteOrder, and te::common::Swap4Bytes().
|
protectedvirtual |
Implements te::gm::Visitor.
Definition at line 337 of file WKBWriter.cpp.
References te::common::BaseVisitable< T, R >::accept(), te::gm::Geometry::getGeomTypeId(), te::gm::PolyhedralSurface::getNumPatches(), te::gm::PolyhedralSurface::getPatchN(), m_byteOrder, m_wkb, te::common::Globals::sm_machineByteOrder, and te::common::Swap4Bytes().
|
inlineprotectedvirtual |
Implements te::gm::Visitor.
Definition at line 106 of file WKBWriter.h.
|
protectedvirtual |
|
protectedvirtual |
|
inlineprotectedvirtual |
Implements te::gm::Visitor.
Definition at line 109 of file WKBWriter.h.
|
inlineprotectedvirtual |
Implements te::gm::Visitor.
Definition at line 110 of file WKBWriter.h.
|
inlineprotectedvirtual |
Implements te::gm::Visitor.
Definition at line 111 of file WKBWriter.h.
| void te::gm::WKBWriter::write | ( | const Geometry * | geom | ) |
It serializes the geometry to a WKB representation into the specified buffer.
| geom | The geometry to be serialized. |
Definition at line 145 of file WKBWriter.cpp.
References te::common::BaseVisitable< T, R >::accept().
Referenced by te::gm::Geometry::getWkb(), and wkbConversionExamples().
|
static |
It serializes the geometry to a WKB representation into the specified buffer.
The wkb parameter must have at least geom.getWkbSize() in order to be used. Don't pass a NULL pointer or a buffer smaller than the size needed. Note that the WKB will be on the specified byte order.
| geom | The geometry to be serialized. |
| wkb | The buffer where the geometry will be serialized. |
| byteOrder | The byte order used to store/serialize the geometry. |
Definition at line 150 of file WKBWriter.cpp.
References te::common::BaseVisitable< T, R >::accept().
|
private |
The byte order used to encode the WKB.
Definition at line 116 of file WKBWriter.h.
|
private |
A pointer that marks the current position in a buffer to be write when parsing the geometry.
Definition at line 115 of file WKBWriter.h.