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);
54class CPL_DLL OGRWKBPointUpdater
58 virtual ~OGRWKBPointUpdater();
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,
114 if (!
Grow(nItemSize))
141 virtual bool Grow(
size_t nItemSize) = 0;
156 bool m_bCanUseStrtod =
false;
170 bool bCanAlterByteAfter);
Append buffer that can be grown dynamically.
Definition ogr_wkb.h:99
size_t m_nSize
Number of valid bytes in the buffer.
Definition ogr_wkb.h:133
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
void * m_pRawBuffer
Raw buffer pointer.
Definition ogr_wkb.h:136
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.
size_t m_nCapacity
Capacity of the buffer (ie number of bytes allocated).
Definition ogr_wkb.h:130
Simple container for a bounding region in 3D.
Definition ogr_core.h:199
Simple container for a bounding region (rectangle).
Definition ogr_core.h:44
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.
OGRWKTToWKBTranslator(OGRAppendBuffer &oAppendBuffer)
Constructor.
Definition ogr_wkb.cpp:1428
size_t TranslateWKT(void *pabyWKTStart, size_t nLength, bool bCanAlterByteAfter)
Translate the WKT geometry starting at pabyWKTStart and of length nLength.
Definition ogr_wkb.cpp:1444
Core portability definitions for CPL.
unsigned char GByte
Unsigned byte type.
Definition cpl_port.h:175
Core portability services for cross-platform OGR code.