PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ pgis_asmvt_serialfn()

Datum pgis_asmvt_serialfn ( PG_FUNCTION_ARGS  )

Definition at line 210 of file lwgeom_out_mvt.c.

211 {
212 #ifndef HAVE_LIBPROTOBUF
213  elog(ERROR, "ST_AsMVT: Compiled without protobuf-c support");
214  PG_RETURN_NULL();
215 #else
216  mvt_agg_context *ctx;
217  bytea *result;
218  elog(DEBUG2, "%s called", __func__);
219  if (!AggCheckCallContext(fcinfo, NULL))
220  elog(ERROR, "%s called in non-aggregate context", __func__);
221 
222  if (PG_ARGISNULL(0))
223  {
224  bytea *emptybuf = palloc(VARHDRSZ);
225  SET_VARSIZE(emptybuf, VARHDRSZ);
226  PG_RETURN_BYTEA_P(emptybuf);
227  }
228 
229  ctx = (mvt_agg_context *) PG_GETARG_POINTER(0);
230  result = mvt_ctx_serialize(ctx);
231  if (ctx->trans_context)
232  MemoryContextDelete(ctx->trans_context);
233  ctx->trans_context = NULL;
234  PG_RETURN_BYTEA_P(result);
235 #endif
236 }
char result[OUT_DOUBLE_BUFFER_SIZE]
Definition: cu_print.c:262
bytea * mvt_ctx_serialize(mvt_agg_context *ctx)
Definition: mvt.c:1126
MemoryContext trans_context
Definition: mvt.h:62

References mvt_ctx_serialize(), result, and mvt_agg_context::trans_context.

Here is the call graph for this function: