PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ flatgeobuf_agg_finalfn()

uint8_t* flatgeobuf_agg_finalfn ( struct flatgeobuf_agg_ctx ctx)

Finalize aggregation.

Encode into Data message and return it packed as a bytea.

Definition at line 558 of file flatgeobuf.c.

559 {
560  POSTGIS_DEBUGF(3, "called at offset %ld", ctx->ctx->offset);
561  if (ctx == NULL)
562  flatgeobuf_agg_ctx_init(NULL, false);
563  // header only result
564  if (ctx->ctx->features_count == 0) {
565  flatgeobuf_encode_header(ctx->ctx);
566  } else if (ctx->ctx->create_index) {
567  ctx->ctx->index_node_size = 16;
568  flatgeobuf_create_index(ctx->ctx);
569  }
570  if (ctx->tupdesc != NULL)
571  ReleaseTupleDesc(ctx->tupdesc);
572  SET_VARSIZE(ctx->ctx->buf, ctx->ctx->offset);
573  POSTGIS_DEBUGF(3, "returning at offset %ld", ctx->ctx->offset);
574  return ctx->ctx->buf;
575 }
struct flatgeobuf_agg_ctx * flatgeobuf_agg_ctx_init(const char *geom_name, const bool create_index)
Initialize aggregation context.
Definition: flatgeobuf.c:503
flatgeobuf_ctx * ctx
Definition: flatgeobuf.h:48
TupleDesc tupdesc
Definition: flatgeobuf.h:51

References flatgeobuf_agg_ctx::ctx, and flatgeobuf_agg_ctx_init().

Referenced by pgis_asflatgeobuf_finalfn().

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