PostGIS  2.5.2dev-r@@SVN_REVISION@@

◆ mvt_agg_init_context()

void mvt_agg_init_context ( mvt_agg_context ctx)

Initialize aggregation context.

Definition at line 920 of file mvt.c.

References mvt_agg_context::bool_values_hash, mvt_agg_context::column_cache, mvt_agg_context::double_values_hash, mvt_agg_context::extent, mvt_agg_context::features_capacity, FEATURES_CAPACITY_INITIAL, mvt_agg_context::float_values_hash, mvt_agg_context::geom_index, mvt_agg_context::keys_hash, mvt_agg_context::keys_hash_i, mvt_agg_context::layer, mvt_agg_context::name, mvt_agg_context::sint_values_hash, mvt_agg_context::string_values_hash, mvt_agg_context::tile, UINT32_MAX, mvt_agg_context::uint_values_hash, and mvt_agg_context::values_hash_i.

Referenced by pgis_asmvt_transfn().

921 {
922  VectorTile__Tile__Layer *layer;
923 
924  POSTGIS_DEBUG(2, "mvt_agg_init_context called");
925 
926  if (ctx->extent == 0)
927  elog(ERROR, "mvt_agg_init_context: extent cannot be 0");
928 
929  ctx->tile = NULL;
931  ctx->keys_hash = NULL;
932  ctx->string_values_hash = NULL;
933  ctx->float_values_hash = NULL;
934  ctx->double_values_hash = NULL;
935  ctx->uint_values_hash = NULL;
936  ctx->sint_values_hash = NULL;
937  ctx->bool_values_hash = NULL;
938  ctx->values_hash_i = 0;
939  ctx->keys_hash_i = 0;
940  ctx->geom_index = UINT32_MAX;
941 
942  memset(&ctx->column_cache, 0, sizeof(ctx->column_cache));
943 
944  layer = palloc(sizeof(*layer));
945  vector_tile__tile__layer__init(layer);
946  layer->version = 2;
947  layer->name = ctx->name;
948  layer->has_extent = 1;
949  layer->extent = ctx->extent;
950  layer->features = palloc (ctx->features_capacity *
951  sizeof(*layer->features));
952 
953  ctx->layer = layer;
954 }
struct mvt_kv_double_value * double_values_hash
Definition: mvt.h:72
struct mvt_kv_string_value * string_values_hash
Definition: mvt.h:70
char * name
Definition: mvt.h:60
mvt_column_cache column_cache
Definition: mvt.h:79
VectorTile__Tile * tile
Definition: mvt.h:67
struct mvt_kv_float_value * float_values_hash
Definition: mvt.h:71
VectorTile__Tile__Layer * layer
Definition: mvt.h:66
uint32_t keys_hash_i
Definition: mvt.h:77
size_t features_capacity
Definition: mvt.h:68
#define UINT32_MAX
Definition: lwin_wkt_lex.c:343
struct mvt_kv_uint_value * uint_values_hash
Definition: mvt.h:73
uint32_t geom_index
Definition: mvt.h:63
struct mvt_kv_bool_value * bool_values_hash
Definition: mvt.h:75
uint32_t values_hash_i
Definition: mvt.h:76
#define FEATURES_CAPACITY_INITIAL
Definition: mvt.c:40
uint32_t extent
Definition: mvt.h:61
struct mvt_kv_key * keys_hash
Definition: mvt.h:69
struct mvt_kv_sint_value * sint_values_hash
Definition: mvt.h:74
Here is the caller graph for this function: