13#ifndef OGRLAYERARROW_H_DEFINED
14#define OGRLAYERARROW_H_DEFINED
21#include "ogr_recordbatch.h"
23constexpr const char *ARROW_EXTENSION_NAME_KEY =
"ARROW:extension:name";
24constexpr const char *ARROW_EXTENSION_METADATA_KEY =
"ARROW:extension:metadata";
25constexpr const char *EXTENSION_NAME_OGC_WKB =
"ogc.wkb";
26constexpr const char *EXTENSION_NAME_GEOARROW_WKB =
"geoarrow.wkb";
27constexpr const char *EXTENSION_NAME_ARROW_JSON =
"arrow.json";
29std::map<std::string, std::string>
30 CPL_DLL OGRParseArrowMetadata(
const char *pabyMetadata);
32bool CPL_DLL OGRCloneArrowArray(
const struct ArrowSchema *schema,
33 const struct ArrowArray *array,
34 struct ArrowArray *out_array);
36bool CPL_DLL OGRCloneArrowSchema(
const struct ArrowSchema *schema,
37 struct ArrowSchema *out_schema);
46 memset(&m_stream, 0,
sizeof(m_stream));
61 m_stream.release(&m_stream);
62 m_stream.release =
nullptr;
67 inline ArrowArrayStream *
get()
76 return m_stream.get_schema(&m_stream, schema);
83 return m_stream.get_next(&m_stream, array);
92 memcpy(&m_stream, &(other.m_stream),
sizeof(m_stream));
93 memset(&(other.m_stream), 0,
sizeof(m_stream));
99 struct ArrowArrayStream m_stream
C++ wrapper on top of ArrowArrayStream.
Definition: ogrlayerarrow.h:41
ArrowArrayStream * get()
Return the raw ArrowArrayStream*.
Definition: ogrlayerarrow.h:67
int get_next(struct ArrowArray *array)
Get the next ArrowArray batch.
Definition: ogrlayerarrow.h:81
int get_schema(struct ArrowSchema *schema)
Get the schema.
Definition: ogrlayerarrow.h:74
OGRArrowArrayStream & operator=(OGRArrowArrayStream &&other)
Move assignment operator.
Definition: ogrlayerarrow.h:87
OGRArrowArrayStream()
Constructor: instantiate an empty ArrowArrayStream
Definition: ogrlayerarrow.h:44
void clear()
Call release() on the ArrowArrayStream if not already done.
Definition: ogrlayerarrow.h:57
~OGRArrowArrayStream()
Destructor: call release() on the ArrowArrayStream if not already done.
Definition: ogrlayerarrow.h:50
Core portability definitions for CPL.