PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ mvt_ctx_to_bytea()

static bytea* mvt_ctx_to_bytea ( mvt_agg_context ctx)
static

Definition at line 1252 of file mvt.c.

1253 {
1254  /* Fill out the file slot, if it's not already filled. */
1255  /* We should only have a filled slow when all the work of building */
1256  /* out the data is complete, so after a serialize/deserialize cycle */
1257  /* or after a context combine */
1258  size_t len;
1259  bytea *ba;
1260 
1261  if (!ctx->tile)
1262  {
1263  ctx->tile = mvt_ctx_to_tile(ctx);
1264  }
1265 
1266  /* Zero features => empty bytea output */
1267  if (ctx && ctx->layer && ctx->layer->n_features == 0)
1268  {
1269  bytea *ba = palloc(VARHDRSZ);
1270  SET_VARSIZE(ba, VARHDRSZ);
1271  return ba;
1272  }
1273 
1274  /* Serialize the Tile */
1275  len = VARHDRSZ + vector_tile__tile__get_packed_size(ctx->tile);
1276  ba = palloc(len);
1277  vector_tile__tile__pack(ctx->tile, (uint8_t*)VARDATA(ba));
1278  SET_VARSIZE(ba, len);
1279  return ba;
1280 }
static VectorTile__Tile * mvt_ctx_to_tile(mvt_agg_context *ctx)
Definition: mvt.c:1237
VectorTile__Tile__Layer * layer
Definition: mvt.h:66
VectorTile__Tile * tile
Definition: mvt.h:67
unsigned char uint8_t
Definition: uthash.h:79

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: