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";
30constexpr const char *GAS_OPT_DATETIME_AS_STRING =
"DATETIME_AS_STRING";
32std::map<std::string, std::string>
33 CPL_DLL OGRParseArrowMetadata(
const char *pabyMetadata);
35bool CPL_DLL OGRCloneArrowArray(
const struct ArrowSchema *schema,
36 const struct ArrowArray *array,
37 struct ArrowArray *out_array);
39bool CPL_DLL OGRCloneArrowSchema(
const struct ArrowSchema *schema,
40 struct ArrowSchema *out_schema);
49 memset(&m_stream, 0,
sizeof(m_stream));
64 m_stream.release(&m_stream);
65 m_stream.release =
nullptr;
70 inline ArrowArrayStream *
get()
79 return m_stream.get_schema(&m_stream, schema);
86 return m_stream.get_next(&m_stream, array);
95 memcpy(&m_stream, &(other.m_stream),
sizeof(m_stream));
98 memset(&(other.m_stream), 0,
sizeof(m_stream));
104 struct ArrowArrayStream m_stream
ArrowArrayStream * get()
Return the raw ArrowArrayStream*.
Definition ogrlayerarrow.h:70
int get_next(struct ArrowArray *array)
Get the next ArrowArray batch.
Definition ogrlayerarrow.h:84
int get_schema(struct ArrowSchema *schema)
Get the schema.
Definition ogrlayerarrow.h:77
OGRArrowArrayStream & operator=(OGRArrowArrayStream &&other)
Move assignment operator.
Definition ogrlayerarrow.h:90
OGRArrowArrayStream()
Constructor: instantiate an empty ArrowArrayStream.
Definition ogrlayerarrow.h:47
void clear()
Call release() on the ArrowArrayStream if not already done.
Definition ogrlayerarrow.h:60
~OGRArrowArrayStream()
Destructor: call release() on the ArrowArrayStream if not already done.
Definition ogrlayerarrow.h:53
Core portability definitions for CPL.