PostGIS  2.5.0dev-r@@SVN_REVISION@@
static bytea* mvt_ctx_to_bytea ( mvt_agg_context ctx)
static

Definition at line 890 of file mvt.c.

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

Referenced by mvt_agg_finalfn(), and mvt_ctx_serialize().

891 {
892  /* Fill out the file slot, if it's not already filled. */
893  /* We should only have a filled slow when all the work of building */
894  /* out the data is complete, so after a serialize/deserialize cycle */
895  /* or after a context combine */
896 
897  if (!ctx->tile)
898  {
899  ctx->tile = mvt_ctx_to_tile(ctx);
900  }
901 
902  /* Zero features => empty bytea output */
903  if (ctx && ctx->layer && ctx->layer->n_features == 0)
904  {
905  bytea *ba = palloc(VARHDRSZ);
906  SET_VARSIZE(ba, VARHDRSZ);
907  return ba;
908  }
909 
910  /* Serialize the Tile */
911  size_t len = VARHDRSZ + vector_tile__tile__get_packed_size(ctx->tile);
912  bytea *ba = palloc(len);
913  vector_tile__tile__pack(ctx->tile, (uint8_t*)VARDATA(ba));
914  SET_VARSIZE(ba, len);
915  return ba;
916 }
static VectorTile__Tile * mvt_ctx_to_tile(mvt_agg_context *ctx)
Definition: mvt.c:876
VectorTile__Tile * tile
Definition: mvt.h:57
VectorTile__Tile__Layer * layer
Definition: mvt.h:56
unsigned char uint8_t
Definition: uthash.h:79

Here is the call graph for this function:

Here is the caller graph for this function: