80 #ifndef HAVE_LIBPROTOBUF 81 elog(ERROR,
"Missing libprotobuf-c");
84 MemoryContext aggcontext;
87 if (!AggCheckCallContext(fcinfo, &aggcontext))
88 elog(ERROR,
"pgis_asmvt_transfn: called in non-aggregate context");
89 MemoryContextSwitchTo(aggcontext);
91 if (PG_ARGISNULL(0)) {
92 ctx = palloc(
sizeof(*ctx));
93 ctx->
name =
"default";
94 if (PG_NARGS() > 2 && !PG_ARGISNULL(2))
95 ctx->
name = text_to_cstring(PG_GETARG_TEXT_P(2));
97 if (PG_NARGS() > 3 && !PG_ARGISNULL(3))
98 ctx->
extent = PG_GETARG_INT32(3);
100 if (PG_NARGS() > 4 && !PG_ARGISNULL(4))
101 ctx->
geom_name = text_to_cstring(PG_GETARG_TEXT_P(4));
107 if (!type_is_rowtype(get_fn_expr_argtype(fcinfo->flinfo, 1)))
108 elog(ERROR,
"pgis_asmvt_transfn: parameter row cannot be other than a rowtype");
109 ctx->
row = PG_GETARG_HEAPTUPLEHEADER(1);
112 PG_FREE_IF_COPY(ctx->
row, 1);
113 PG_RETURN_POINTER(ctx);
void mvt_agg_init_context(struct mvt_agg_context *ctx)
Initialize aggregation context.
void mvt_agg_transfn(struct mvt_agg_context *ctx)
Aggregation step.