PostGIS  3.3.9dev-r@@SVN_REVISION@@

◆ mvt_ctx_to_bytea()

static bytea* mvt_ctx_to_bytea ( mvt_agg_context ctx)
static

Definition at line 1096 of file mvt.c.

1097 {
1098  /* Fill out the tile slot, if it's not already filled. */
1099  /* We should only have a filled slot when all the work of building */
1100  /* out the data is complete, so after a serialize/deserialize cycle */
1101  /* or after a context combine */
1102  size_t len;
1103  bytea *ba;
1104 
1105  if (!ctx->tile)
1106  {
1107  ctx->tile = mvt_ctx_to_tile(ctx);
1108  }
1109 
1110  /* Zero features => empty bytea output */
1111  if (ctx && ctx->layer && ctx->layer->n_features == 0)
1112  {
1113  ba = palloc(VARHDRSZ);
1114  SET_VARSIZE(ba, VARHDRSZ);
1115  return ba;
1116  }
1117 
1118  /* Serialize the Tile */
1119  len = VARHDRSZ + vector_tile__tile__get_packed_size(ctx->tile);
1120  ba = palloc(len);
1121  vector_tile__tile__pack(ctx->tile, (uint8_t*)VARDATA(ba));
1122  SET_VARSIZE(ba, len);
1123  return ba;
1124 }
static VectorTile__Tile * mvt_ctx_to_tile(mvt_agg_context *ctx)
Definition: mvt.c:1081
VectorTile__Tile__Layer * layer
Definition: mvt.h:76
VectorTile__Tile * tile
Definition: mvt.h:80

References mvt_agg_context::layer, mvt_ctx_to_tile(), and mvt_agg_context::tile.

Referenced by mvt_agg_finalfn(), and mvt_ctx_serialize().

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