PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ flatgeobuf_agg_ctx_init()

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

Initialize aggregation context.

Definition at line 503 of file flatgeobuf.c.

504 {
505  struct flatgeobuf_agg_ctx *ctx;
506  size_t size = VARHDRSZ + FLATGEOBUF_MAGICBYTES_SIZE;
507  ctx = palloc0(sizeof(*ctx));
508  ctx->ctx = palloc0(sizeof(flatgeobuf_ctx));
509  ctx->ctx->buf = lwalloc(size);
510  memcpy(ctx->ctx->buf + VARHDRSZ, flatgeobuf_magicbytes, FLATGEOBUF_MAGICBYTES_SIZE);
511  ctx->geom_name = geom_name;
512  ctx->geom_index = 0;
513  ctx->ctx->features_count = 0;
514  ctx->ctx->offset = size;
515  ctx->tupdesc = NULL;
516  ctx->ctx->create_index = create_index;
517  return ctx;
518 }
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: