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";
29constexpr const char *EXTENSION_NAME_ARROW_JSON =
"arrow.json";
32constexpr const char *EXTENSION_NAME_ARROW_TIMESTAMP_WITH_OFFSET =
33 "arrow.timestamp_with_offset";
35constexpr const char *ATSWO_TIMESTAMP_FIELD_NAME =
"timestamp";
36constexpr const char *ATSWO_OFFSET_MINUTES_FIELD_NAME =
"offset_minutes";
39constexpr const char *GAS_OPT_DATETIME_AS_STRING =
"DATETIME_AS_STRING";
41std::map<std::string, std::string>
42 CPL_DLL OGRParseArrowMetadata(
const char *pabyMetadata);
44bool CPL_DLL OGRCloneArrowArray(
const struct ArrowSchema *schema,
45 const struct ArrowArray *array,
46 struct ArrowArray *out_array);
48bool CPL_DLL OGRCloneArrowSchema(
const struct ArrowSchema *schema,
49 struct ArrowSchema *out_schema);
58 memset(&m_stream, 0,
sizeof(m_stream));
73 m_stream.release(&m_stream);
74 m_stream.release =
nullptr;
79 inline ArrowArrayStream *
get()
88 return m_stream.get_schema(&m_stream, schema);
95 return m_stream.get_next(&m_stream, array);
104 memcpy(&m_stream, &(other.m_stream),
sizeof(m_stream));
107 memset(&(other.m_stream), 0,
sizeof(m_stream));
113 struct ArrowArrayStream m_stream{};
C++ wrapper on top of ArrowArrayStream.
Definition ogrlayerarrow.h:53
ArrowArrayStream * get()
Return the raw ArrowArrayStream*.
Definition ogrlayerarrow.h:79
int get_next(struct ArrowArray *array)
Get the next ArrowArray batch.
Definition ogrlayerarrow.h:93
int get_schema(struct ArrowSchema *schema)
Get the schema.
Definition ogrlayerarrow.h:86
OGRArrowArrayStream & operator=(OGRArrowArrayStream &&other)
Move assignment operator.
Definition ogrlayerarrow.h:99
OGRArrowArrayStream()
Constructor: instantiate an empty ArrowArrayStream
Definition ogrlayerarrow.h:56
void clear()
Call release() on the ArrowArrayStream if not already done.
Definition ogrlayerarrow.h:69
~OGRArrowArrayStream()
Destructor: call release() on the ArrowArrayStream if not already done.
Definition ogrlayerarrow.h:62
Core portability definitions for CPL.