33 #include "utils/builtins.h" 34 #include "executor/spi.h" 36 #include "../postgis_config.h" 37 #include "lwgeom_pg.h" 48 #if ! (defined HAVE_LIBPROTOBUF && defined HAVE_GEOBUF) 49 elog(ERROR,
"Missing libprotobuf-c >= version 1.1");
52 MemoryContext aggcontext;
55 if (!AggCheckCallContext(fcinfo, &aggcontext))
56 elog(ERROR,
"pgis_asmvt_transfn: called in non-aggregate context");
57 MemoryContextSwitchTo(aggcontext);
59 if (PG_ARGISNULL(0)) {
60 ctx = palloc(
sizeof(*ctx));
63 if (PG_NARGS() > 2 && !PG_ARGISNULL(2))
64 ctx->
geom_name = text_to_cstring(PG_GETARG_TEXT_P(2));
70 if (!type_is_rowtype(get_fn_expr_argtype(fcinfo->flinfo, 1)))
71 elog(ERROR,
"pgis_asgeobuf_transfn: parameter row cannot be other than a rowtype");
72 ctx->
row = PG_GETARG_HEAPTUPLEHEADER(1);
75 PG_RETURN_POINTER(ctx);
85 #if ! (defined HAVE_LIBPROTOBUF && defined HAVE_GEOBUF) 86 elog(ERROR,
"Missing libprotobuf-c >= version 1.1");
91 if (!AggCheckCallContext(fcinfo, NULL))
92 elog(ERROR,
"pgis_asmvt_finalfn called in non-aggregate context");
99 PG_RETURN_BYTEA_P(buf);
PG_FUNCTION_INFO_V1(pgis_asgeobuf_transfn)
Process input parameters and row data into state.
Datum pgis_asgeobuf_finalfn(PG_FUNCTION_ARGS)
void geobuf_agg_transfn(struct geobuf_agg_context *ctx)
Aggregation step.
void geobuf_agg_init_context(struct geobuf_agg_context *ctx)
Initialize aggregation context.
uint8_t * geobuf_agg_finalfn(struct geobuf_agg_context *ctx)
Finalize aggregation.
Datum pgis_asgeobuf_transfn(PG_FUNCTION_ARGS)
This library is the generic geometry handling section of PostGIS.