PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ flatgeobuf_agg_ctx_init()

struct flatgeobuf_agg_ctx* flatgeobuf_agg_ctx_init ( const char *  geom_name,
const bool  create_index 
)

Initialize aggregation context.

Definition at line 502 of file flatgeobuf.c.

503 {
504  struct flatgeobuf_agg_ctx *ctx;
505  size_t size = VARHDRSZ + FLATGEOBUF_MAGICBYTES_SIZE;
506  ctx = palloc0(sizeof(*ctx));
507  ctx->ctx = palloc0(sizeof(flatgeobuf_ctx));
508  ctx->ctx->buf = lwalloc(size);
509  memcpy(ctx->ctx->buf + VARHDRSZ, flatgeobuf_magicbytes, FLATGEOBUF_MAGICBYTES_SIZE);
510  ctx->geom_name = geom_name;
511  ctx->geom_index = 0;
512  ctx->ctx->features_count = 0;
513  ctx->ctx->offset = size;
514  ctx->tupdesc = NULL;
515  ctx->ctx->create_index = create_index;
516  return ctx;
517 }
void * lwalloc(size_t size)
Definition: lwutil.c:227
const char * geom_name
Definition: flatgeobuf.h:49
flatgeobuf_ctx * ctx
Definition: flatgeobuf.h:48

References flatgeobuf_agg_ctx::ctx, flatgeobuf_agg_ctx::geom_name, and lwalloc().

Referenced by flatgeobuf_agg_finalfn(), and pgis_asflatgeobuf_transfn().

Here is the call graph for this function:
Here is the caller graph for this function: