13#ifndef OGR_WKB_H_INCLUDED
14#define OGR_WKB_H_INCLUDED
23bool CPL_DLL OGRWKBGetGeomType(
const GByte *pabyWkb,
size_t nWKBSize,
24 bool &bNeedSwap, uint32_t &nType);
25bool OGRWKBPolygonGetArea(
const GByte *&pabyWkb,
size_t &nWKBSize,
27bool OGRWKBMultiPolygonGetArea(
const GByte *&pabyWkb,
size_t &nWKBSize,
30bool CPL_DLL OGRWKBGetBoundingBox(
const GByte *pabyWkb,
size_t nWKBSize,
33bool CPL_DLL OGRWKBGetBoundingBox(
const GByte *pabyWkb,
size_t nWKBSize,
36bool CPL_DLL OGRWKBIntersectsPessimistic(
const GByte *pabyWkb,
size_t nWKBSize,
39void CPL_DLL OGRWKBFixupCounterClockWiseExternalRing(
GByte *pabyWkb,
50const GByte CPL_DLL *WKBFromEWKB(
GByte *pabyEWKB,
size_t nEWKBSize,
51 size_t &nWKBSizeOut,
int *pnSRIDOut);
61 virtual bool update(
bool bNeedSwap,
void *x,
void *y,
void *z,
void *m) = 0;
64bool CPL_DLL OGRWKBUpdatePoints(
GByte *pabyWkb,
size_t nWKBSize,
70#ifdef OGR_WKB_TRANSFORM_ALL_AT_ONCE
71 std::vector<bool> abNeedSwap{};
72 std::vector<bool> abIsEmpty{};
73 std::vector<void *> apdfX{};
74 std::vector<void *> apdfY{};
75 std::vector<void *> apdfZ{};
76 std::vector<void *> apdfM{};
77 std::vector<double> adfX{};
78 std::vector<double> adfY{};
79 std::vector<double> adfZ{};
80 std::vector<double> adfM{};
81 std::vector<int> anErrorCodes{};
88bool CPL_DLL OGRWKBTransform(
GByte *pabyWkb,
size_t nWKBSize,
112 if (nItemSize > m_nCapacity - m_nSize)
114 if (!Grow(nItemSize))
117 void *pRet =
static_cast<GByte *
>(m_pRawBuffer) + m_nSize;
118 m_nSize += nItemSize;
130 size_t m_nCapacity = 0;
136 void *m_pRawBuffer =
nullptr;
141 virtual bool Grow(
size_t nItemSize) = 0;
156 bool m_bCanUseStrtod =
false;
169 size_t TranslateWKT(
void *pabyWKTStart,
size_t nLength,
170 bool bCanAlterByteAfter);
Append buffer that can be grown dynamically.
Definition ogr_wkb.h:99
size_t GetSize() const
Return the number of valid bytes in the buffer.
Definition ogr_wkb.h:123
void * GetPtrForNewBytes(size_t nItemSize)
Return the pointer at which nItemSize bytes can be written, or nullptr in case of error.
Definition ogr_wkb.h:110
virtual bool Grow(size_t nItemSize)=0
Extend the capacity of m_pRawBuffer to be at least m_nSize + nItemSize large.
virtual ~OGRAppendBuffer()
Destructor.
OGRAppendBuffer()
Constructor.
Simple container for a bounding region in 3D.
Definition ogr_core.h:200
Simple container for a bounding region (rectangle)
Definition ogr_core.h:45
Object to update point coordinates in a WKB geometry.
Definition ogr_wkb.h:55
virtual bool update(bool bNeedSwap, void *x, void *y, void *z, void *m)=0
Update method.
Translate WKT geometry to WKB geometry and append it to a buffer.
Definition ogr_wkb.h:154
Core portability definitions for CPL.
unsigned char GByte
Unsigned byte type.
Definition cpl_port.h:169
Core portability services for cross-platform OGR code.